Re: Removing NSLog & NSAssert for deployment
Re: Removing NSLog & NSAssert for deployment
- Subject: Re: Removing NSLog & NSAssert for deployment
- From: Bill Cheeseman <email@hidden>
- Date: Thu, 07 Feb 2002 16:19:54 -0500
on 02-02-07 3:19 PM, John C. Randolph at email@hidden wrote:
>
On Thursday, February 7, 2002, at 03:43 AM, Bill Cheeseman wrote:
>
>
> Is it useful to remove NSLog and NSAssert macro calls when building an
>
> Objective-C Cocoa application for deployment -- whether for performance
>
> reasons or otherwise? If so, how is this normally done? Is there a
>
> preprocessor macro for this?
>
>
I tend to just bracket NSAssert calls with #ifdef
>
debug..#endif. (This may not be the canonical way, though.)
Scott Anguish suggested the same thing, more or less. But I'm not satisfied.
Here's my reply to Scott, which applies equally to you:
I know I can define my own debug conditional in every source file and change
all of them manually for deployment -- the traditional C way.
I was hoping that Project Builder's Development and Deployment "Build
Styles" radio buttons in Project Builder somehow propagated macros or
something into the development environment so that I don't have to change
them manually in each file. I guess what you're telling me is, No such luck.
Well, actually, the Apple Help files for NSAssert do state (somewhat
unclearly) that you can use #ifdefined NS_BLOCK_ASSERTIONS around NSAssert
calls, presumably to block them in deployment builds. The Help files for
NSLog make no similar statement.
The Help files don't say where to define NS_BLOCK_ASSERTIONS, or whether it
gets defined automatically if you build for Deployment. As usual, the Help
files assume you already know everything about the system, so they don't
offer much detail. I guess I can figure this part out easily enough by
myself with a little experiment. But can you shed any light on this?
--
Bill Cheeseman - email@hidden
Quechee Software, Quechee, Vermont, USA
http://www.quecheesoftware.com
The AppleScript Sourcebook -
http://www.AppleScriptSourcebook.com
Vermont Recipes -
http://www.stepwise.com/Articles/VermontRecipes
Croquet Club of Vermont -
http://members.valley.net/croquetvermont
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.