views:

158

answers:

2

I want to build my iPhone app to work on iPhone OS 2.0 up to 3.0. According to this page, you simply need to set the "Base SDK" to 3.0 and the "iPhone OS deployment target" to 2.0.

My question is, when actually building the application, which "Active SDK" should I choose? I get the following choices:

  • 2.0
  • 2.1
  • 2.2
  • 2.2.1
  • 3.0

My guess is that it simply doesn't matter, but I would like to make sure.

+2  A: 

You should choose the SDK you want to deploy your application to. Compiling to a specific SDK allows you to make sure you're not using too-new features (from the developer side) and actually links the code to the right shared libraries (from the application side).

Aviad Ben Dov
A: 

You probably want to set the active SDK to 3.0. Any libraries new to the SDK 3.0, like the MessageUI.framework can be marked as weak linked in the "General" tab of the Targets info dialog. This does mean you will have to keep track of new symbols you might be using and verify they exist before attempting to call them.

For example to see if the new mail sending controller is available you can do:

Class mfMailComposeViewControllerClass = NSClassFromString(@"MFMailComposeViewController");
if(mfMailComposeViewControllerClass != nil) // SDK 3.0

This way you can make use of new features while still having backwards support.

And BTW, it probably isn't worth it supporting pre-3.0, the bulk of potential users have already moved to 3.0, and the few iPod Touch users that haven't are probably too cheap to buy much software.

Glenn Howes
I wish it was that simple. There are many "this behaves differently on 3.0" sentences littering the docs.... To really teat your app, you would need to link to the old libs.
Aviad Ben Dov