NSLog在Release版本也会调用 - - NSAssert NSCAssert

来源:互联网 发布:北风网大数据百度云 编辑:程序博客网 时间:2024/05/16 14:37

Remember to remove or comment out NSLog calls before shipping your app, as you probably don’t want your finished app to dump lots of messages into the console.


For higher-level asserts, look at NSAssert (used in Objective-C methods) and NSCAssert (used in C functions).


Some developers think that asserts should be allowed to remain in your code even when your app is finished. By default, however, higher-level NSAssert and NSCAssert are disabled in a Release build, thanks to the Enable Foundation Assertions build setting, which is set to No for the Release configuration in Apple’s project templates. To keep asserts working in a Release build, change that value to Yes for your app target.


原创粉丝点击