Re: How dangerous is +load?
Re: How dangerous is +load?
- Subject: Re: How dangerous is +load?
- From: Nat! <email@hidden>
- Date: Thu, 1 May 2003 17:13:32 +0200
Am Donnerstag, 01.05.03 um 08:51 Uhr schrieb Marcel Weiher:
On Thursday, May 1, 2003, at 07:11 Uhr, Georg Tuparev wrote:
On Thursday, May 1, 2003, at 02:55 Europe/Amsterdam, Daniel Zitter
wrote:
Georg wrote:
But I really do not want to create any
dependancies between the class in question and NSApp or its
delegate.
I am confused by this requirement. One line of initialization code
in the app or app delegate class is a small dependancy. Could you
elaborate on the motivation for this requirement? Can we not assume
you have the ability to recompile the application(s) you wish to >>
test?
What if the class of interest is a part of a plugin, and the original
author of NSApp's delegate have no idea about the existence of this
plugin? But even if this is not the case, one line of dependancy is
one line too much.
Well, if you're in a plugin, then you have a pretty good chance that
Foundation has already been loaded, right? After all, your plugin was
loaded by NSBundle and NSBundle is part of Foundation, so Foundation
must be there.
I think it's impossible to have +load of your NSObject based subclass
be called before Foundation is loaded into the runtime system. It's
because you need to link with the Foundation and the loader will always
load that dependency before your code will be called.
If subclass (Bar) and baseclass (Foo:NSObject) are in the same dylib,
then there is a danger (due to link ordering) that the Bar +load will
be called before the Foo +load.
That's at least how I understand the situation :)
Ciao
Nat!
------------------------------------------------------
But didn't I always tell you, honey, if I just stayed
in place and I never spoke up, good things are bound
to happen ? -- Jonathan Gems
_______________________________________________
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.