Re: Memory allocation issues with NSObject and NSString
Re: Memory allocation issues with NSObject and NSString
- Subject: Re: Memory allocation issues with NSObject and NSString
- From: glenn andreas <email@hidden>
- Date: Tue, 20 Jan 2009 09:07:47 -0600
On Jan 19, 2009, at 11:04 PM, Michael Ash wrote:
I maintain that NSObject -init is guaranteed to do nothing, and
changing this fact would seriously break the API contract.
I read it that it does nothing to initialize the object (since the
object has nothing that needs to be initialized). That doesn't
preclude that it may not do something debugging related book keeping,
for example.
But even if it does nothing what so ever, you still can't skip calling
it. The documentation is quite clear that you need to do [super init]
(or another init method) regardless:
"Subclass versions of init need to incorporate the initialization code
for the classes they inherit from, through a message to super"
So even though it is contracted to do nothing, subclass inits are
contracted that they need to call super.
Glenn Andreas email@hidden
<http://www.gandreas.com/> wicked fun!
Mad, Bad, and Dangerous to Know
_______________________________________________
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