• 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: I want my app to crash!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: I want my app to crash!


  • Subject: Re: I want my app to crash!
  • From: Andy Lee <email@hidden>
  • Date: Wed, 17 Jun 2009 07:37:59 -0400

On Jun 17, 2009, at 6:29 AM, M Pulis wrote:
Most of us see the alloc init pattern when learning from example code for a quick feature demo. For purposes of brevity, example code is never meant to demonstrate error handling, much like I don't expect to see MyClass in shipping source.

The reason for the alloc/init idiom is to avoid this easy-to-make mistake:


    MyClass *myObject = [MyClass alloc];
    [myObject init];

I don't mean this as an answer to the larger question about nil- messaging, but to point out that this is an explicitly recommended idiom, not just a way for the authors of the examples to save a few keystrokes.

--Andy

_______________________________________________

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:
    • NSImageView/NSImage question
      • From: Marco S Hyman <email@hidden>
    • Re: I want my app to crash!
      • From: M Pulis <email@hidden>
References: 
 >Re: I want my app to crash! (From: Andreas Grosam <email@hidden>)
 >Re: I want my app to crash! (From: M Pulis <email@hidden>)

  • Prev by Date: Re: Group CGAffineTransform Animations?
  • Next by Date: Re: I want my app to crash!
  • Previous by thread: Re: I want my app to crash!
  • Next by thread: Re: I want my app to crash!
  • Index(es):
    • Date
    • Thread