Re: I want my app to crash!
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