Re: cocoa-dev digest, Vol 2 #2085 - 11 msgs
Re: cocoa-dev digest, Vol 2 #2085 - 11 msgs
- Subject: Re: cocoa-dev digest, Vol 2 #2085 - 11 msgs
- From: Greg Titus <email@hidden>
- Date: Wed, 19 Mar 2003 09:15:46 -0800
On Wednesday, March 19, 2003, at 08:02 AM, Georg Tuparev wrote:
On Tuesday, Mar 18, 2003, at 23:32 Europe/Amsterdam, John C. Randolph
wrote:
This is rather interesting. What provokes the +initialize call to be
made?
The Apple Obj-C runtime calls +initialize for every class it loads,
before sending any other messages to that class or any instances of
that class. Usually, classes you write will be derived from Object
or NSObject, and will simply inherit their +initialize method.
Hmm. My experimenting shows, and the docs claim that +load is called
before +initialize. But if you rewrite the paragraph above saying that
+initialize is the first useful general hook to override, we will be
friends again ;-)
Yes, John worded his statement a little incorrectly. +load is called
for every class the Obj-C runtime loads, immediately after the
bundle/app/framework is loaded.
But then, +initialize is called just before the first message to any
class or instance. Note that this means that if you have a class linked
into your app that you never actually use, +load will get called, but
+initialize will not!
Hope this helps,
- Greg
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.