Re: Re: [self init] vs. [super init] in initWithCoder
Re: Re: [self init] vs. [super init] in initWithCoder
- Subject: Re: Re: [self init] vs. [super init] in initWithCoder
- From: "Shawn Erickson" <email@hidden>
- Date: Fri, 18 Aug 2006 14:12:26 -0700
On 8/18/06, glenn andreas <email@hidden> wrote:
If you make a subclass of Foo and in your initWithCoder call [self
init], that would end up allocating dict (in -[Foo init]), and then
[super initWithCoder:] will decode another dictionary, leaking the
old one.
Of course if you used a setter to set your dictionary (or capabilities
of Objective-C v2) you wouldn't have to worry about that type of
mistake. ;)
-Shawn
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden