Re: variable sensitive to Active Build Configuration
Re: variable sensitive to Active Build Configuration
- Subject: Re: variable sensitive to Active Build Configuration
- From: Rob Keniger <email@hidden>
- Date: Tue, 11 Nov 2008 10:03:43 +1000
On 11/11/2008, at 8:47 AM, JB wrote:
I'm building a small app that talks to a web service, so I would
like use
different URLs for the DEBUG vs. RELEASE targets (staging and
production
URLs, respectively). What is the best way to conditionally set a
variable
based on the Active Build Configuration?
In Xcode, open the build settings for your target. Make sure you're
editing the settings for the Debug target only and in the
"Preprocessor Macros" section, add "DEBUG" (without the quotes).
You can then do this in your source:
#ifdef DEBUG
NSLog(@"Debug build");
#else
NSLog(@"Release build");
#endif
--
Rob Keniger
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden