Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Developing app for 10.8+ but using 10.9 SDK

Mavericks is coming out and for developers that's always a busy time with all these new features and APIs to know about and use. For me, I think it is the perfect time to ask a question that has been bugging me for a very long time.

Here's the thing, in context: I am developing an app that I want to be able to run on 10.8 (so the target system is 10.8+). Right now I am using the 10.8 SDK. However, with the release of 10.9 comes some pretty sweet APIs that I would like to use in my app. I use them in my code, but then, of course, I have to compile my app against the 10.9 SDK. If I do that, can I still run the app on 10.8?

Or, in a more general way, if I compile my app against one SDK, can I still run it on a 'lower' Mac OS? If yes, can you explain how does it work under the hood (what is the compiler doing)? This is a mistery for me.

like image 651
Alex Avatar asked Jun 15 '13 20:06

Alex


3 Answers

Generally speaking, Xcode disassociates the issue of the SDK and the Deployment Target of the app.

The SDK is determined by Base SDK, and the deployment target is determined by OS X Deployment Target. These both show up in the Build Settings tab for each target in Xcode.

When programming with different SDK and Target, you are responsible for making sure that you don't call methods or functions on an OS that doesn't have them. This is often facilitated by weak linking (in the case of new frameworks) and/or using -respondsToSelector: in the case of new methods on existing classes and frameworks.

like image 85
gaige Avatar answered Oct 28 '22 19:10

gaige


In Xcode, under build settings, there is an option for target OS where you can pick 10.8. 10.8 applications are generally compatible with 10.9 so the compiled application will work with both OSs.

like image 1
ultimatetechie Avatar answered Oct 28 '22 19:10

ultimatetechie


Don't expect the new Apis to work when running on a lower version. It doesn't work that way.

like image 1
Abizern Avatar answered Oct 28 '22 21:10

Abizern