Re: Framework soft link (optional install)
Re: Framework soft link (optional install)
- Subject: Re: Framework soft link (optional install)
- From: Kyle Sluder <email@hidden>
- Date: Wed, 13 Jan 2010 20:26:42 -0800
2010/1/13 Trygve Inda <email@hidden>:
> How can I compile/link my code so that the framework effectively has a soft
> link? I will need to check for the presence of the framework at runtime, and
> if it is not there, avoid calling into it, but if the user has added it, the
> functionality would be available.
Weak link the framework, according to the details here:
http://developer.apple.com/mac/library/DOCUMENTATION/MacOSX/Conceptual/BPFrameworks/Concepts/WeakLinking.html
Note that there is no direct ObjC analogue for the NULLing function
symbol behavior (at least not yet; see
http://sealiesoftware.com/blog/archive/2009/09/09/objc_explain_Weak-import_classes.html
for a glimpse into the future). At the moment, you can use
NSClassNamed to get at the classes you need, then shove them off into
a variable and check for non-Nilness.
--Kyle Sluder
_______________________________________________
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