0

I'm developing with Xcode 4.6.2, which includes iOS 6.1 SDK. I need to make my app compatible from iOS 5, and I don`t know exactly how should I manage this backwards compatibility. I've downloaded the iOS 5.0 simulator, but I'm not sure if I also need to get the iOS 5.0 SDK package, which I don´t know in what Xcode version it is included. I've set de deployment target to 5.0 as well. Does Xcode alert if I try to use in code features that are only available in later iOS versions? Should I try to only use features available in iOS 5.0, or the best practice is to check the device's current iOS version and decide if it can take advantage of newest features if iOS version is later than iOS 5.0?

Thanks in advance

AppsDev
  • 12,319
  • 23
  • 93
  • 186
  • @rmaddy I think not exactly... I read in [this document](http://developer.apple.com/library/ios/#documentation/DeveloperTools/Conceptual/cross_development/Overview/overview.html#//apple_ref/doc/uid/20002001-BABEBGCF) that there are two approaches: building a target optimized for one version, or build a target for a range of versions with conditions. The point is that I don't know what approach to take, since I dont entirely understand how each of them will work at development stage (SDKs needed, and detection of features not available in older versions) – AppsDev Jul 04 '13 at 15:24
  • @rmaddy I assume that, even if I optimize for iOS 5, it will always run on later iOS versions, right? The problem arises only in backwards compatibility... – AppsDev Jul 04 '13 at 15:27
  • You must always use the last SDK as the Base SDK. At the moment this is 6.1 but it will soon be 7.0. Writing a new app now that supports iOS 5 is almost pointless. Apple states over 95% of users are on iOS 6. It's up to you if you want to support iOS 5 or not. But you must support iOS 6. If you decide to also support iOS 5, you need to use the techniques shown in the SDK Compatibility Guide document to ensure you don't use iOS 6 APIs if the app is on an iOS 5 device. – rmaddy Jul 04 '13 at 15:31
  • Apple only delivers the latest iOS SDK with Xcode, and tells us to set the deployment target e.g. to iOS 5.0. UNFORTUNATELY, the compiler does not warn you about methods not available in the deployment version, even if all methods are tagged with the availability macros. – Martin R Jul 04 '13 at 15:32
  • @MartinR It looks like if I set both the deployment target and base SDK settings to 5.0, I'll need to look for the iOS 5.0 SDK package... wherever it is included... but does not this way ensure that I won´t make use of any feature that is not available in iOS 5.0, and at the same time that I'll be able to run in iOS versions up to the latest? – AppsDev Jul 04 '13 at 15:41

0 Answers0