PaulpauL

Xcode 出了8.0后,代码运行日志过长时会出现打印不全的问题.

这可能是Xcode优化的一项,不过这也给开发带来的不必要的麻烦.下面的宏定义可以解决这一问题.

#ifdef DEBUG

#define NSLog( s, ... ) printf("class: <%p %s:(%d) > method: %s \n%s\n", self, [[[NSString stringWithUTF8String:__FILE__] lastPathComponent] UTF8String], __LINE__, __PRETTY_FUNCTION__, [[NSString stringWithFormat:(s), ##__VA_ARGS__] UTF8String] );

#else

#define NSLog( s, ... )

#endif

分类:

技术点:

相关文章:

  • 2021-12-31
  • 2022-01-02
  • 2021-05-13
  • 2021-12-04
  • 2021-09-12
  • 2021-12-31
  • 2021-09-28
  • 2021-09-28
猜你喜欢
  • 2021-06-11
  • 2021-06-16
  • 2021-09-25
  • 2021-07-03
  • 2021-04-10
  • 2021-12-03
  • 2021-09-19
相关资源
相似解决方案