Re: choose framework version at runtime
Re: choose framework version at runtime
- Subject: Re: choose framework version at runtime
- From: Chris Hanson <email@hidden>
- Date: Tue, 04 Aug 2015 12:29:44 -0700
As long as you don’t actually link the framework, you can load it at runtime via -[NSBundle loadAndReturnError:], and look up classes in it via NSClassFromString after it’s loaded.
You could also implement a pair of bundles, one which your app would load on 10.6 and one which your app would load on 10.7 or later. The bundles would be what link the framework rather than your app; the bundles could present the same protocol-based API from their principal class, so the only decision your app needs to make is which one to load.
-- Chris
> On Aug 2, 2015, at 4:01 AM, sqwarqDev <email@hidden> wrote:
>
> Is it possible to build a single app target and link it to one version or another of a (3rd party) framework at runtime, depending on the OS X version the user is running?
>
> Specifically, my app runs on 10.6 or later, but adding Sparkle v1.11 requires 10.7 minimum. I understand I need to use Sparkle 1.5b for SL users, but I want to build both the old and new versions of Sparkle into a single binary and have the appropriate one linked to at run time.
>
> Unfortunately, after a day of chasing red herrings (largely due to my own relative ignorance of linking, compiling and frameworks), I’m still none the wiser as to how to do this.
>
> Any pointers would be much appreciated.
>
>
> Best
>
>
> Phil
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Xcode-users mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden