我经常这么做
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);
基本上我做
CLog (@"VariableName %@", VariableName)
有没有办法把它变成一个宏?
答案 0 :(得分:3)
这应该有效 - 像这样定义宏:
#define CLOG(x) CLog(@#x " %@", x)
然后像这样调用它:
CLOG(someNew.Title);