• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: choose framework version at runtime
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • way/add-on to create/edit class method definitions for .hpp/.cpp in “one-step"
      • From: Dan Stenning <email@hidden>
References: 
 >choose framework version at runtime (From: sqwarqDev <email@hidden>)

  • Prev by Date: Re: choose framework version at runtime
  • Next by Date: __attribute((noescape)) doesn't prevent retain-cycle errors
  • Previous by thread: Re: choose framework version at runtime
  • Next by thread: way/add-on to create/edit class method definitions for .hpp/.cpp in “one-step"
  • Index(es):
    • Date
    • Thread