• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: [super initialize]?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: [super initialize]?
      • From: Jim Correia <email@hidden>
References: 
 >[super initialize]? (From: "Christopher Hickman" <email@hidden>)

  • Prev by Date: (no subject)
  • Next by Date: Re: [super initialize]?
  • Previous by thread: [super initialize]?
  • Next by thread: Re: [super initialize]?
  • Index(es):
    • Date
    • Thread