• 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30

プリプロセッサ マクロとかコンパイラ フラグとか苦手です。
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ではこんな感じに設定してみました:
NS_BLOCK_ASSERTIONS_compiler flags.png

##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ではこんな感じに設定してみました:
NS_BLOCK_ASSERTIONS_preprocessing.png

ちなみに:

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

posted by satoko satoko on Tue 18 Sep 2012 at 15:19 with 8 comments
Contents rssrss
Leading Smart TV App Development Companies | USA | 4 Way Technologies
Apple TV Developer | TVOS Development | USA | 4 Way Technologies
光ファイバーを二次元振動させて走査するAR用ディスプレイ
因果の取り違え
Value Transformer
Swift2's defer for CoffeeScript
mongodb-3.0からcreateIndexのdropDupsが無くなったらしい
mongodb-3.0以降のWiredTigerの設定を動的に変更する方法
一般楕円の高速生成アルゴリズムへの道標
farro mantecatoのレシピ
Tags
iphone開発
Comments rssrss
https://xn--krken21-bn4c.com https://xn--krken21-bn4c.com: Как отличить настоящий маркетплейс от подделки Kra... 05/01 12:20
https://example.com/xkkpsk https://example.com/xkkpsk: Great blog you have here.. It's difficult to find ... 05/01 09:31
https://onlinemo.ir https://onlinemo.ir: جمع‌بندی برای اون گروه از کاربرا که سیستم‌ها... 05/01 00:58
https://xn--mgmarkt9-9db.com https://xn--mgmarkt9-9db.com: Как обезопасить MEGA: настройка менеджера паролей ... 04/30 20:14
https://qeshmtourist.ir https://qeshmtourist.ir: در کل قضیه برای اونایی که می‌خوان وارد بشن س... 04/30 19:31
https://negarinadv.ir https://negarinadv.ir: سلام و عرض ادب، بنده مدتی قبل هنگام گشتن تو اینت... 04/30 18:56
https://gsmcharge.ir https://gsmcharge.ir: در کل قضیه برای کاربران علاقه‌مند به پلتفرم‌... 04/30 13:51
https://azardl.ir https://azardl.ir: در کل برای کاربرایی که در جستجو هستن پلتفرم‌... 04/30 02:42