Re: Crash help?
Re: Crash help?
- Subject: Re: Crash help?
- From: Michael David Crawford <email@hidden>
- Date: Thu, 20 Aug 2015 13:02:39 -0700
Assert the validity of all your method parameters. While it can help to
assert return results thats less helpful as most return results are later
used as input parameters:
#import <assert.h>
- (void) foo( int *p, int n )
{
assert( NULL != p && n > 0 && n < 10 );
...
return;
}
This might not have found the crash we're discussing but it will find many
others by the time you ship. Also assertions are more effective than
comments for documenting APIs because one is forced to maintain them along
with the rest of the code.
- Mike
--
Michael David Crawford P.E., Consulting Process Architect
email@hidden
http://mike.soggywizard.com/
One Must Not Trifle With Wizards For It Makes Us Soggy And Hard To
Light.
_______________________________________________
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