Reputation: 33130
I often do this a lot
CLog(@"someNew.Title %@", someNew.Title); //Working
CLog (@"_currentBusiness.managedObjectContext %@",_currentBusiness.managedObjectContext);
CLog (@"someNew.managedObjectContext %@",someNew.managedObjectContext);
CLog (@"[ThreadClass managedObjectContext] %@",[ThreadClass managedObjectContext]);
CLog (@"UIAppDelegate.managedObjectContext %@",UIAppDelegate.managedObjectContext);
Basically I do
CLog (@"VariableName %@", VariableName)
Is there a way to turn this into a macro?
Upvotes: 1
Views: 71
Reputation: 213080
This should work - define the macro like this:
#define CLOG(x) CLog(@#x " %@", x)
and then invoke it like this:
CLOG(someNew.Title);
Upvotes: 3