iOS开发技巧之: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~

猜你喜欢

转载自blog.csdn.net/vkooy/article/details/81382858
今日推荐