Re: self = [super init], nil?
Re: self = [super init], nil?
- Subject: Re: self = [super init], nil?
- From: Kyle Sluder <email@hidden>
- Date: Sat, 8 May 2010 08:27:47 -0700
On May 8, 2010, at 8:12 AM, Kyle Sluder <email@hidden>
wrote:
Now that we have blocks, I expect we'll be using a lot less of
this, but with our current codebase it pays to be safe.
To be clear, I'm not suggesting that I check the return value of
every -init call. Rather, I only check the ones that are likely to
return nil. Often these are the ones that have error arguments.
But as far as implementing -init goes, I always check super's return
value. After all, I'm reassigning self, so I've already potentially
broken the guarantee of having a valid self pointer by virtue of
being in an ObjC method. Why override good muscle memory for the
special case of NSObject?
--Kyle Sluder
_______________________________________________
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