Neznajka
Neznajka

Reputation: 305

Create project for iOS5 on XCode 4.6

Tell me please, how can I create project for iOS5 + in my XCode 4.6, where all builds for iOS6 +

I change Deployment Target

enter image description here

And how change base SDK? Or maybe I cann't change it?

enter image description here

And what I must do, that my XCode show me warnings if I will try use methods, that can be used only in iOS 6+?

Upvotes: 5

Views: 2291

Answers (2)

giorashc
giorashc

Reputation: 13713

For your first question as far as I know ios 5 api will also be supported in later versions. You should set your target to ios 5.0 (via your project target settings) for making sure that none of the ios6 methods are used (or else a compilation error will prevent you from building it).

In order to support new features and check if ios6 is available on the device you have two ways :

  1. During compilation (so you can still build your app with lower targets and newer together) use the following macro
#if __IPHONE_OS_VERSION_MIN_REQUIRED > __IPHONE_6_0
 // Your ios6 code goes here
#endif

2: During runtime : [[[UIDevice currentDevice] systemVersion] floatValue] > 6.0

Upvotes: 1

Anil Varghese
Anil Varghese

Reputation: 42977

First you should understand a few things. Deployment target is the minimum OS version that your app supports. If you set into iOS 5.0 you can assure that it's support iOS 5.0 and above. Base SDK is the SDK which is used to compile your application. Always use latest SDK available.

If you want to create app that support iOS5.0 and above set deployment target as 5.0. Then use latest SDK available. The reason is that if you change base SDK to some lower version, your app may not support ios6 since some of the methods are deprecated in iOS6. If you compile it with latest SDK it shows warning. You can test your app by installing different simulators to check wether it is working properly. Mainly you need to handle orientation issues since it is different in both.

You can use conditional compilation. Remember not use autoLayout and attributed strings. Which wont support in ios5

Upvotes: 6

Related Questions