Re: Making failed NSAsserts crash an app
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