14

I've upgraded to XCode 4 which comes with the 4.3 version of the SDK.

But we'd like to make sure our app runs on devices that have 4.2 and later, not just 4.3.

Is there a setting in XCode that can be configured so we don't have to force upgrade everyone just yet?

Jonas Anderson
  • 1,987
  • 4
  • 24
  • 28

2 Answers2

26

There are two settings in the project settings that affect which platforms you app will support:

  • Base SDK : The name or path of the base SDK being used during the build.
  • Deployment Target : Code will load on this and later versions of iOS.

The first sets the SDK that you link against and the second sets the iOS versions that your app will support. It is important to understand this note on the Deployment Target setting:

Framework APIs that are unavailable in earlier versions will be weak-linked; your code should check for null function pointers or specific system versions before calling newer APIs.

So if you are using any APIs that only exist in 4.3, make sure those frameworks are weak-linked and that your code checks the iOS version before using those APIs.

RedBlueThing
  • 42,006
  • 17
  • 96
  • 122
  • 2
    Instead of checking the iOS version, most of the time, it's better to check for null function pointers, or use -respondsToSelector:, etc. – Elliot Oct 27 '11 at 06:51
  • 1
    I'm not sure why this is the accepted answer. The issue is that in XCode 4, there is no entry in the drop down box for Deployment target for 4.2, only 4.3. Additionally, the organizer in XCode 4 says: "Unsupported device. Devices of type “iPod touch (2nd generation)” are not supported by this version of Xcode." Seems like Apple has abandoned development for these older devices that would require 4.2. – Craig B Nov 15 '12 at 22:42
15

You should always set base sdk as the latest version, then the lowest supported version is determined by "deployment target" setting.

As long as deployment target is set to at/below 4.2, it should be fine..

Sean S Lee
  • 1,274
  • 9
  • 24
  • I'm using `Xcode 4.3.3 (4E3002)` and I've set `Base SDK` to `Latest iOS (iOS 5.1)` and `Deployment Target` to **4.2** however when I deploy the build app to my old jailbroken iPod (**Ver. 4.2.1**) nothing happens. I have the Organizer to deploy output build to the device, It says **info.plist specifies device capability requirements, which are not met by my iPod**. I modified **UIRequiredDeviceCapabilities** in `info.plist` to **armv6** and now it says **This application does support this device's CPU type**. Any idea? – anonim Nov 16 '12 at 13:39