Re: NSLog() replacement for debugger output
Re: NSLog() replacement for debugger output
- Subject: Re: NSLog() replacement for debugger output
- From: "Michael Ash" <email@hidden>
- Date: Fri, 25 Apr 2008 00:31:33 -0400
On Thu, Apr 24, 2008 at 11:57 PM, Jens Alfke <email@hidden> wrote:
>
> On 24 Apr '08, at 8:09 PM, Michael Ash wrote:
>
>
> > It's only useful for multi-statement macros.
> >
>
> And macros that use an 'if':
>
> extern BOOL gVerboseMode;
> #define LOG(X) if(gVerboseMode) NSLog(@"value = %i",X);
Isn't this two statements? You have an if statement followed by a
function call to NSLog.
Not that it's particularly important but your example won't compile.
You include a semicolon in the macro definition and also in the source
code, which will separate the else from its if and cause a parse
error.
Mike
_______________________________________________
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