Re: [self init] vs. [super init] in initWithCoder
Re: [self init] vs. [super init] in initWithCoder
- Subject: Re: [self init] vs. [super init] in initWithCoder
- From: Jim Correia <email@hidden>
- Date: Sat, 19 Aug 2006 17:14:54 -0400
On Aug 19, 2006, at 12:41 PM, John McLaughlin wrote:
You bring up a good point -- In my case I use Accessorizer
extensively so I never, ever, set anything except through setters
so I wouldn't leak (although it is arguable less efficient since
you init an object that then immediately get's deallocated)
There are caveats/considerations to using public accessor methods
from -init or -dealloc. Since they are public, they can be overridden
by subclasses (and will potentially have side effects even if the
original methods did not.) If a subclass overrides a public accessor,
and you use it from init, the subclass may not be prepared to deal
with a partially constructed object. Something to consider...
Jim
_______________________________________________
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