tags:

views:

395

answers:

2

After I downloaded the latest Xcode with the 3.1.2 SDK, I can't build and test for 2.2.1 anymore. I have the 2.2.1 SDK in the proper directory of my Developer folder.

Is there a setting I have to change?

A: 

Where are you trying to select it? As the base SDK? You should always be linking against the newest SDK version (this is what an Apple engineer told me directly at an iphone dev event) and then set your Deployment Target back as far as you want. You should be able to set you iPhone OS Deployment Target back to the older SDK version.

This is because Xcode uses weak linking so it will leave out things from the newer SDK on older versions, you do need to do some conditional checking for specific API's/functions using things like respondsToSelector if you are using functionality that has changed across versions.

paulthenerd
+3  A: 

Yes, to choose an older SDK in the Active SDK popup you have to set either the Base SDK or the Deployment Target build setting of your target to a value equal to or less than 2.2.1.

The Base SDK expresses your intention of what API your code is written for. The Deployment Target expresses your intention of the earliest iPhone OS you want your app to run on.

The Active SDK is your build-time choice of SDK to use, usually Device vs. Simulator. But you will fail if you try to build against an SDK that is older than what your code is written for. If you code is indeed written to compile against older SDKs and/or run on older OS versions, you must express this by setting the appropriate build settings in the Target. Otherwise the Active SDK popup will limit you to what it knows will work with your code.

cdespinosa