可能重複:
Is it true that one should not use NSLog() on production code?
Do I need to disable NSLog before release Application?從發行刪除的NSLog構建
我需要刪除所有這些都存在於我的項目發佈版本在NSLOGs。我曾嘗試使用下面的代碼,但仍然通過電話訪問構建,仍然在控制檯中顯示NSLOG。
#ifdef DEBUG
#define debug_NSLog(format, ...) NSLog(format, ## __VA_ARGS__)
#else
#define debug_NSLog(format, ...)
#endif
您是否在代碼中使用'debug_NSLog'代替'NSLog'? – mttrb
請將常數值分配給.pch文件,並指定布爾值並檢查天氣的值是否爲true,然後顯示其他方式不顯示。 –
可能你的答案在這裏http://stackoverflow.com/questions/300673/is-it-true-that-one-should-not-use-nslog-on-production-code –