简体   繁体   中英

Building iPhone app for earlier iPhone OS versions

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.

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).

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM