• 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: Removing NSLog & NSAssert for deployment
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >Re: Removing NSLog & NSAssert for deployment (From: "John C. Randolph" <email@hidden>)

  • Prev by Date: Re: Removing NSLog & NSAssert for deployment
  • Next by Date: Re: [somewhat OT] portable C under OjbC
  • Previous by thread: Re: Removing NSLog & NSAssert for deployment
  • Next by thread: Re: Removing NSLog & NSAssert for deployment
  • Index(es):
    • Date
    • Thread