/**
* 完美解决Xcode NSLog打印不全的宏 亲测目前支持到8.2bate版
*/
#ifdef DEBUG
//#define NSLog(format, ...) printf("class: <%p %s:(%d) > method: %s \n%s\n", self, [[[NSString stringWithUTF8String:__FILE__] lastPathComponent] UTF8String], __LINE__, __PRETTY_FUNCTION__, [[NSString stringWithFormat:(format), ##__VA_ARGS__] UTF8String] )
#define NSLog(...) printf("%f %s\n",[[NSDate date]timeIntervalSince1970],[[NSString stringWithFormat:__VA_ARGS__]UTF8String]);
#else
#define NSLog(format, ...)
#endif
本文介绍了一种在Xcode中使用宏定义优化NSLog打印的方法,此方法能够更详细地记录调用位置和时间,适用于调试阶段,且已验证支持到Xcode 8.2 beta版本。

242

被折叠的 条评论
为什么被折叠?



