Re: Enabling NSZombieEnabled depending on build configuration.
Re: Enabling NSZombieEnabled depending on build configuration.
- Subject: Re: Enabling NSZombieEnabled depending on build configuration.
- From: James Bucanek <email@hidden>
- Date: Fri, 14 Jul 2006 07:28:00 -0700
AEC Software - Óscar Morales Vivó wrote on Friday, July 14, 2006:
>However I find it pretty annoying that it has to be set on the
>executable at launch. It would be a lot less prone to trouble if it
>could be set by build configuration (i.e. debug can have it on, while
>it's off for the release build).
I usually do this by creating a pre-processor macro that indicates that I'm in "development."
Add a macro definition to either the "Preprocessor Macros" or "Preprocessor Macros Not Use in Precompiled Headers," as appropriate, of your project or target build settings but only for your "Debug" configuration:
GCC_PREPROCESSOR_DEFINITIONS = IN_DEVELOPMENT=1
Then bracket all debug related support code with that.
#ifndef IN_DEVELOPMENT
#define IN_DEVELOPMENT 0 /* NO if not declared in the build settings */
#endif
...
int main( int argv, char** argc )
{
...
#if IN_DEVELOPMENT
NSDebugEnabled = YES;
NSZombieEnabled = YES;
//NSDeallocateZombies = YES;
#endif
...
This code only gets compiled when building my "Debug" configuration.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden