• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: variable sensitive to Active Build Configuration
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >variable sensitive to Active Build Configuration (From: JB <email@hidden>)

  • Prev by Date: Re: MVC and Cocoa question
  • Next by Date: Re: Cocoa and NSLog
  • Previous by thread: variable sensitive to Active Build Configuration
  • Next by thread: Quicktime Movie View error
  • Index(es):
    • Date
    • Thread