• 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: Crash help?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Crash help? (From: Shane Stanley <email@hidden>)
 >Re: Crash help? (From: Mike Abdullah <email@hidden>)
 >Re: Crash help? (From: Jens Alfke <email@hidden>)

  • Prev by Date: NSSearchField and Dates
  • Next by Date: Using alarm(3) on background NSOperationQueue threads
  • Previous by thread: Re: Crash help?
  • Next by thread: NSSearchField and Dates
  • Index(es):
    • Date
    • Thread