Xcode8 NSLog打印json不全解决办法

据说国外的大神是这么解决的:

#ifdef DEBUG

#define SLog(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] )

#else

#define SLog(format, ...)

#endif



在此基础上进行了修改:

#ifdef DEBUG//开发阶段

#define NSLog(format,...) printf("%s",[[NSString stringWithFormat:(format), ##__VA_ARGS__] UTF8String])


#else//发布阶段

#define NSLog(...)


问题解决了,OK~



版权声明:本文为sky_yang1024原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。