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 protected])

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to