Re: Strategies to prevent class name clashes
Re: Strategies to prevent class name clashes
- Subject: Re: Strategies to prevent class name clashes
- From: Thomas Engelmeier <email@hidden>
- Date: Fri, 15 Feb 2008 15:57:05 +0100
On 15.02.2008, at 13:35, Arne Scheffler wrote:
No, dyld as of Mac OS X 10.2 supports two-level namespaces.
Otherwise AudioUnits and VST plug-ins wouldn't work on Mac OS X. As
an example every VST plug-in just exports one C function and yet I
haven't heard of a host only be able to load one VST plug-in.
OK, with two level namespaces that is partially resolved.
I think what you mean is if some one tries to load a dylib and
there's already a dylib with the same name in the process, than
you're right it only loads the first one.
IIRC the symbol resolution is applicable to referenced symbols, but
not to bundle entry points.
With Objective-C now this won't work anymore.
Certainly not. If I understood it correctly, objc_lookUpClass does not
know the concept of namespaces, and classes get added at bundle load
time to the internal class lookup table.
[[foo alloc] init];
is AFAIK (not sure 'bout the SEL lookup..) equivalent to
id aClass = objc_getClass( "foo" ); // NO NAMESPACES HERE - plain
ASCII class name!!!!
id anObject = objc_msgSend( aClass, sel_getUid( "alloc") );
objc_msgSend( anObject, sel_getUid( "init") );
How does framework versioning work for Cocoa ? If one plug-in got
compiled with say version 1 and another got compiled with version 2.
Will they both work ?
You´re right: it won't work.
How is that possible as Objective-C only allows one class with the
same name ?
See above. The Objective-C runtime reference is pretty enlightening by
revealing some implementation details, the "Code loading programming
topics for Cocoa" contains some more clarifications...
Regards,
Tom_E
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden