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