• 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
NSAssertやNSLogを無効にする:-DNS_BLOCK_ASSERTIONS=1とNS_BLOCK_ASSERTIONS
GDBでview.frameを表示させる
Core Animationについてのリンク集
[iPhone] new BSDライセンスについてライセンス引用のメモ
Implementing a Container View Controller in UIViewController Class Reference
UITableView用のNSIndexPathの作り方
Xcodeのテンプレート、View-based ApplicationとWindow-based Applicationの違い
CopyOnSelectのLion対応
Xcode4のCode Snippetsを別のPCに移動する+gitで管理する
[iPhone] Singleton: iOS4以降はGCDのdispatch_onceを使う
Tags
iphone開発gitIBInterfaceBuilderiOSSIMBLSnippetsterminaltwitterxcodeXcode4
Comments rssrss
guest guest: Muchos turistas buscan la mejor forma de llegar a ... 05/30 03:19
guest guest: San Antonio de Areco es conocido como la cuna de l... 05/27 19:47
guest guest: Optimizar el tiempo durante un viaje de negocios e... 05/18 00:46
guest guest: Para muchos turistas, el transporte publico y la l... 05/15 18:22
Services from s21g
MagicBag
MagicBagは、Cloudflare R2やS3互換ストレージをMacのFinderから扱えるファイル同期クライアントです。
アンテナショップめぐり
東京にある全国のアンテナショップ、イベント、特産品を地図や条件から探せるサービスです。
YOMU Web小説リーダー
YOMUは、Web小説の読み上げに特化したiPhoneアプリです。
補助探
公開されている補助金・助成金情報を集約し、条件に合う制度を探しやすくするサービスです。
jotter.me
jotter.meは、考えやアイデア、情報を書き留めるためのノートサービスです。