Re: Categories and +initialize
Re: Categories and +initialize
- Subject: Re: Categories and +initialize
- From: Nat! <email@hidden>
- Date: Sun, 6 Jan 2002 20:40:23 +0100
On Sonntag, Januar 6, 2002, at 06:32 Uhr, Norbert Heger wrote:
>
A few days ago it was stated on this list, that categories can
>
have their
>
own +initialize method:
>
>
John C. Randolph wrote:
>
> Also, categories can have an +initialize method as well, which
>
> will be called before any other method in that category.
>
>
Indeed, the +initialize method of a category will be called, but
>
only due to
>
the fact that the category implementation *overrides* the class's
>
previous
>
implementation (if existent).
>
>
I just ran into that problem by implementing + initialize in an NSFont
>
category, which caused my app to break entirely, since the
>
original +[NSFont
>
initialize] method was no longer called. Therefore, if you want to
>
perform
>
some category specific initialization, you should implement +load
>
instead.
>
>
Best Regards, Norbert
Is that guaranteed to work ?
Nat!
------------------------------------------------------
Some people drink deep from the fountains of life, and
some just gargle. -- DLR