Re: [super initialize]?
Re: [super initialize]?
- Subject: Re: [super initialize]?
- From: Scott Anguish <email@hidden>
- Date: Fri, 2 Sep 2005 18:29:04 -0400
On Sep 2, 2005, at 3:39 PM, Christopher Hickman wrote:
I was reading AGProcess.m and saw this class method:
+ (void)initialize {
AGMachStatsInit();
[super initialize];
}
Isn't the [super initialize] message wrong, or at least redundant? I
thought the docs said that the runtime sends +initialize messages to
superclasses before their subclasses get them.
Yes, it's wrong, and redundant. the superclass' initialize will
get called before the subclass' will. you should probably try and
make sure that your own classes that implement initialize are 'safe'
if they get called twice though. just for safety sake
this is confusing to many people since it's the opposite of
other methods.
Oh, and this often confuses devs when dealing with KVO dependent
key trigger situations..
Is there any reason to do this?
Not that I can think of at the moment.
_______________________________________________
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