Re: NSLog and deployment builds
Re: NSLog and deployment builds
- Subject: Re: NSLog and deployment builds
- From: Dix Lorenz <email@hidden>
- Date: Mon, 31 Jan 2005 21:24:50 +0100
On 31.01.2005, at 20:35, Julian Vrieslander wrote:
I put the following in my <AppName>_Prefix.pch file:
#define ZNLog if([[NSUserDefaults standardUserDefaults]
boolForKey:@"WriteDebugInfo"])NSLog
This is a one line macro (remove the break if it wrapped). I have
statements like the following in my code
ZNLog(@"The value of foo is: %@", foo);
You need to be really careful with "if" in a macro. Code such as
if (someCondition)
ZNLog(whatever);
else
ZNLog(somethingelse);
will not have the expected result because the else-clause will not be
executed when someCondition is not true (as expected) but only if
someCondition is true and the Key is not set.
Greetings,
Dix
_______________________________________________
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