開発時はNSLogを有効にして、Enterprise, Release時には無効にしたい。

1. {ProjectName}_Prefix.pchファイルを開いて以下のコード追加

#ifndef NSLog
#define NSLog( m, args... )
#ifndef NSLog
#define NSLog( m, args... ) NSLog( m, ##args )

2. ターゲットのBuild SettingのPreprocessing
Enterprise, Release に NS_BLOCK_ASSERTIONS=1 追加

以上で、SchemeがDebug時のみNSLogが出力されて、Enterprise, Release時は無視されるようになる。


No comments yet.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Basic HTML is allowed. Your email address will not be published.

Subscribe to this comment feed via RSS