プリプロセッサ マクロとかコンパイラ フラグとか苦手です。
a-haがあったのでメモ。
##compiler flag編:-DNS_BLOCK_ASSERTIONS=1
NSAssertをリリースビルド時に無効して、そのフラグでNSLogも無効にしてしまおうという技です。2009年の記事ですが、参考に:
2009-12-03NSLogとNSAssertをリリース時に無効化する
http://iphone-dev.g.hatena.ne.jp/tokorom/20091203
Xcode 4.5ではこんな感じに設定してみました:
##preprocessing編:DNS_BLOCK_ASSERTIONS
動作的には上と同じ事なのですが、別の書き方。こっちのが文字数少ない分好きです。
Working with Assertions to Debug your Apps Posted on June 27, 2011
http://mobiledevelopertips.com/debugging/working-with-assertions.html
Xcode 4.5ではこんな感じに設定してみました:
ちなみに:
What's the “DNS_BLOCK_ASSERTIONS” (C compiler flag)?
http://stackoverflow.com/questions/2752574/whats-the-dns-block-assertions-c-compiler-flag
Just to clarify, -D defines a constant, and it is one of the confusing flags that doesn't have a space between it and it's parameter
日本語だとここもヒントになりました:
Xcodeでのプリプロセッサ定義
http://romly.com/archives/2009/10/define_by_project_setting.html