今天在修改项目bug的时候,发现了一个莫名奇妙的问题,控制台打印Log少了一大截,什么鬼。。。
那么问题就定位在了NSLog打印上了!
下面是出现问题的宏,应该是Xcode8存在的bug。
#ifndef __OPTIMIZE__
#define NSLog(...) NSLog(__VA_ARGS__)
#else
#define NSLog(...) {}
#endif
换成c函数的printf就完美解决问题。
#ifndef __OPTIMIZE__
#define NSLog(FORMAT, ...) printf("%s\n", [[NSString stringWithFormat:FORMAT, ##__VA_ARGS__] UTF8String])
#else
#define NSLog(...) {}
#endif