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: glenn andreas <email@hidden>
- Date: Sat, 19 Aug 2006 12:47:24 -0500
On Aug 19, 2006, at 11:41 AM, John McLaughlin wrote:
Hi Glenn,
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)
This is just designed to be a simple example showing why it can be
bad to call init a second time - you just plain shouldn't call an
initializer twice on the same object - see also the thread <http://
lists.apple.com/archives/cocoa-dev/2006/Jul/msg00475.html>.
Even if you make sure that all your code is safe to do this (even if
you use accessors in Obj-C 2.0), you have no control over all the
other code in the various frameworks that you use, so one should
avoid getting into bad habits that will someday come back to bite you...
Glenn Andreas email@hidden
<http://www.gandreas.com/> wicked fun!
quadrium2 | build, mutate, evolve, animate | images, textures,
fractals, art
_______________________________________________
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