0

I need to open an Xcode project in older Xcode version to build under the older SDK. What is deployment target option mean in "project settings". Does it mean that I can build my project on latest iOS 4.3 SDK for an iPhone OS 3 device? How about some functions in classes that dont support in older version of SDK?

Moshe
  • 57,511
  • 78
  • 272
  • 425
dpart
  • 157
  • 2
  • 13

2 Answers2

3

Base SDK is the version of the iOS SDK API that your app is compiled with. This means that your app is being built with the libraries for that version of iOS. As Black Frog mentioned, you must use the latest SDK to get your app approved on the App Store.

Deployment Target is the minimum version of iOS on which your app will allow itself to run on. (The App Store prevents older vesions of iOS from installing apps with a Deployment Target that is newer than that version.)

If you wanted your app to use, say, Game Center (which requires iOS 4.1), and run on iOS 3.1.3 or higher, then you would use a Base SDK of 4.1 or higher and a Deployment Target of 3.1.3.

To deal with classes and methods that don't exist, you should check if they exist before using them. Here's a great blog post on managing different versions of iOS and different versions of the SDK.

All Xcode projects since 3.2 have had the same internal format. So, you should be able to open the Xcode project in the older Xcode. In Xcode 3, you can see the project format version in the "Get Info" of your project. (I haven't found this yet in Xcode 4.)

Moshe
  • 57,511
  • 78
  • 272
  • 425
  • Thank you so much But how can i check existance of some classes or methods? – dpart Apr 15 '11 at 20:54
  • @dpart4 - Also, you cannot submit an app to the App Store unless it's base SDK is the current/latest SDK. The Deployment target can be any device you want to support. +1 to Moshe. – Black Frog Apr 15 '11 at 21:23
  • So if i have base sdk 4.0 and deployment target 3.0 my app will work on ios 3 device without errors despite of absence of some functions or classes on ios 3 sdk? For instance MPMovieViewController class – dpart Apr 16 '11 at 07:10
  • 1
    @dpart - No. You will need to check for those classes before you use them and if they don't exist, you will need to provide alternate UI or at least some message explaining that the feature or features are not supported by the older OS. – Moshe Apr 17 '11 at 01:06
  • @Moshe Thank you! I accidentally found a great article in apple documentation about compability http://developer.apple.com/library/mac/#documentation/DeveloperTools/Conceptual/cross_development/Using/using.html – dpart Apr 17 '11 at 07:40
1
  1. Xcode v4 and v3 share the same project format, that should not be a problem to open it.
  2. Depending on your code, you will have to check it is working for the lower version SDK:

    1. Set your Build SDK and Deployment target in project
    2. Build & Check results that should warn/fail
    3. Make sure to check Apple documentations to see if you're not using not yet existing APIs.
    4. Do tests on a real device using that OS version... (very important!!)

If there is a magical way to check iOS compatibility not by hand like this, I'm interested :)

Vincent Guerci
  • 14,379
  • 4
  • 50
  • 56
  • @Moshe my english can be horrible depending on my *(french)* mood ;) – Vincent Guerci Apr 15 '11 at 20:01
  • No problem. (Feel free to get in touch with me if you want to help translate some apps.) – Moshe Apr 15 '11 at 20:06
  • Thank you. I'll check what you adviced! Actually i need determine the the resolution of iPhone to set properly the images for my custom elements and i'm using a MPMoviePlayer to play movie online. In ios 4 it more customized than in ios 3 – dpart Apr 15 '11 at 20:23
  • @dpart note that if your targetting iOS3, using Xcode 4 is possible by building with latest SDK (**`Build SDK`**) and targeting older iOS (**`Deployment target`**) – Vincent Guerci Apr 15 '11 at 20:29