• 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: Making failed NSAsserts crash an app
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Making failed NSAsserts crash an app


  • Subject: Re: Making failed NSAsserts crash an app
  • From: Joar Wingfors <email@hidden>
  • Date: Thu, 27 Aug 2009 22:27:41 -0700

Hello Kyle,

I would beg to differ:

On 27 aug 2009, at 13.23, Kyle Sluder wrote:

Strictly speaking I believe you're more accurately describing an
invariant than an assertion.


Terminology aside, I think that he accurately describes how the Cocoa provided assertion macros are implemented and used in general. These macros allow the developer to describe things that always must be true, and ensures that a failure prevents execution from continuing beyond that point. Used like this, the biggest upshot of turning them off is saving a few CPU cycles, but you will at the same time expose the end user to undefined state and behavior of your application and rob yourself of well defined failure points that assists in troubleshooting.


Not all error states are fatal states.  Assert happens when entering
an error state, and is left out of release.  abort() happens when
entering a fatal state, and is kept in release (hopefully to never be
executed).


For reference, the UNIX assert() calls abort() at the end.


Best,

j o a r


_______________________________________________

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


  • Follow-Ups:
    • Re: Making failed NSAsserts crash an app
      • From: Kyle Sluder <email@hidden>
References: 
 >Making failed NSAsserts crash an app (From: Squ Aire <email@hidden>)
 >Re: Making failed NSAsserts crash an app (From: Rob Keniger <email@hidden>)
 >Re: Making failed NSAsserts crash an app (From: Graham Cox <email@hidden>)
 >RE: Making failed NSAsserts crash an app (From: Squ Aire <email@hidden>)
 >Re: Making failed NSAsserts crash an app (From: Kyle Sluder <email@hidden>)
 >Re: Making failed NSAsserts crash an app (From: Ed Wynne <email@hidden>)
 >Re: Making failed NSAsserts crash an app (From: Kyle Sluder <email@hidden>)

  • Prev by Date: Re: Drawing Text in an NSImage
  • Next by Date: Re: Drawing Text in an NSImage
  • Previous by thread: Re: Making failed NSAsserts crash an app
  • Next by thread: Re: Making failed NSAsserts crash an app
  • Index(es):
    • Date
    • Thread