views:

754

answers:

1

I'm about to publish an app on the app store, and I'm looking to set the minimum OS version as it appears in iTunes as "Requires iPhone OS 3.x or later". 2 questions:

1) Where do I set this in my Xcode project?

2) I'm aware of the UITableViewCell numberOfLines property that is present only in OS > 3.1. If I set my minimum as OS 3.0, will people who have 3.1 be able to see the number of lines properly as I coded? (Obviously people on 3.0 won't be able to)

Thanks.

+5  A: 

What you need to do is change the Deployment Target setting in your project. The Deployment Target specifies the minimum OS you would like your application to run on. This is regardless of the SDK you build against, which should always be the most recent SDK so you can ensure your application runs correctly on the most recent OS version available. So, in short:

  • Set the Base SDK to be the latest OS available
  • Set the Deployment Target to be the earliest OS you'd like your app to run on.

To answer your second question, if you set the Deployment Target to 3.0 your 3.1-only code will no longer compile. There are workarounds to that problem, however.

fbrereto
Thanks for your reply. When you say my 3.1-only code will no longer compile do you mean it won't work even on 3.1 devices?
isaaclimdc
If you set the Deployment Target to 3.1, you will be able to write, compile, and build your application with 3.1 code. If you set the Deployment Target to 3.0, XCode won't successfully compile your application until you clean out all the 3.1-specific code.
fbrereto
In other words when you set the Deployment Target to 3.0, your application will have no 3.1-only code in it, so even if it is run on a 3.1 device you'll only see 3.0 behavior.
fbrereto
But I just did that, and it seems my 3.1 code is fine. Unless the numberOfLines property is not 3.1-only. It just acts weird when it is compiled on 3.0
isaaclimdc
You can compile 3.1 specific code when the deployment target is set to 3.0 without any trouble. The problem will happen when someone runs the app on 3.0 - it'll crash because the 3.1 specific code won't work there.
Jasarien