Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I am relatively new to iOS development, so after watching a bunch of WWDC videos announcing new awesome features for the iPhone SDK, I still got a few questions regarding their support for older devices. Specifically:

  • Do the new compiler features (such as literals support, auto-synthesize, etc) require iOS 6 on the target device, or can the new style code be deployed to iOS 5 devices?
  • Auto-layout for iOS, same question. Will it only be supported on iOS 6, or 5 as well? If it's 6 only, what kind of fallback are we expected to implement?

Would really appreciate if someone could clarify this for me, as I'm thinking about rewriting my older unfinished project and I would love to use some of that improved SDK functionality.

share|improve this question

2 Answers 2

My understanding is that features implemented by the compiler, such as object literals, can be deployed on older systems. Features that require support from the runtime or from new/modified frameworks, probably including auto layout, will require iOS 6.

It's trivial to figure out whether any given feature will work on iOS 5... just build a simple sample project that uses the feature and try to run it under iOS 5. I don't remember how the new auto-synthesize stuff fits in, for example, but you can certainly try it out.

share|improve this answer
    
Auto-synthesize is handled by the compiler so it will probably work with iOS 5 if you use the new versions of Xcode. –  user4051 Jul 8 '12 at 19:15
    
Thanks for the advice. I’ve downloaded the Xcode 4.5 preview and will try to build and deploy a test app onto iOS 5 tonight. Will post an update here. –  Arnold Sakhnov Jul 10 '12 at 0:44
up vote 2 down vote accepted

So I’ve tried this out myself, by running a test app with some new SDK features in the iOS 5 simulator, and the findings are practically as expected though still somewhat disappointing.

The compiler features, such as literals and auto-synthesize, work fine and good. However, if the app tries to access an IB file that contains some auto-layout stuff, the app will crash with this error:

*** Terminating app due to uncaught exception 'NSInvalidUnarchiveOperationException', reason: 'Could not instantiate class named NSLayoutConstraint'

So, although it’s not really surprising, it is now confirmed that auto-layout won’t work on iOS versions prior to 6. I don’t believe there have been any official recommendations on what to use instead and how to provide proper fallbacks, but I believe it’d have to be separate older-iOS-specific XIBs along with same good ol’ manual layouting code.

share|improve this answer
    
This is the kind of issue that mostly goes away over time. According to one source, about 80% of iOS users are on some version of iOS 5 now. Given the convenience of OTA updates, it seems likely that iOS 6 will be adopted quickly when it's available. –  Caleb Jul 10 '12 at 15:03
    
@Caleb, yes it is true that the adoption rate of new iOS versions is generally pleasingly high, but it won’t be for at least another year before we can ditch the support for iOS 5 altogether. At most, we can only afford to stop fully supporting iOS 4, when the 6 comes out. –  Arnold Sakhnov Jul 10 '12 at 23:20

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.