Thanks for that link Kyle, from that reference it appears that it is not 
possible to weak link classes in MacOS X, so the only way to use my subclasses 
of CAShapeLayer would be to move them all to a separate bundle and only load 
that bundle when running on 10.6. 

Something I wondered about was, is it possible to create a dummy CAShapeLayer class and 
do something in the runtime to make sure it uses the dummy one when running on 10.5 and 
the framework one when running on 10.6? I tried out a little test and got an error saying 
"Class CAShapeLayer is implemented in both (QuartzCore) and (my app). One of the two 
will be used. Which one is undefined.", and then it proceeded to use the dummy one 
on 10.6. I'm not sure if it would be possible to get in early in the runtime and remove 
the dummy class or something on 10.6?

So I also wondered if it would be possible to create that dummy class but only 
load it if running on 10.5, but my guess is that wouldn't be possible either, 
because I probably couldn't get to the process early enough to load the bundle 
before the linker had complained about it.

I'm sure you guys would have thought of these possibilities before, but I just 
thought I'd ask, since it would be less work than splitting it out into a 
separate bundle etc etc, and it just seems as if I would be coding for 10.5 
with 10.6 as the exception kind of thing, whereas 90% of the users will be on 
10.6 and we just need to get it running for 6 months or so on 10.5 until the 
rest have moved over.

I hope there is an easier way than creating a bundle that we only load on 
10.6...any suggestions of other things to try would be very welcome.

Thanks

Ken

On 12 Jan, 2011,at 05:00 AM, Kyle Sluder <kyle.slu...@gmail.com> wrote:

On Tue, Jan 11, 2011 at 10:40 AM, Wim Lewis <w...@omnigroup.com> wrote:
You might be able to weakly link the class, in which case dyld will not 
complain but messages to CAShapeLayer will return nil. I don't remember on 
which OS revs it became possible to weak link a class, though. (Weak linking C 
symbols has been possible since 10.2; see TN2064.)

See Greg Parker's website for an explanation of weak-linking ObjC
classes, which became available in iOS 3.1:

http://www.sealiesoftware.com/blog/archive/2009/09/09/objc_explain_Weak-import_classes.html

--Kyle Sluder
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to