• 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: NSLog and deployment builds
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Re: NSLog and deployment builds (From: Julian Vrieslander <email@hidden>)

  • Prev by Date: Re: NSLog and deployment builds
  • Next by Date: Re: Rez not working
  • Previous by thread: Re: NSLog and deployment builds
  • Next by thread: View mpeg2enc
  • Index(es):
    • Date
    • Thread