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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to