5

I'm having trouble finding some good information regarding development with iOS 5 SDK / XCode 4.2 and being able to support older devices - namely the iPhone 3G.

Essentially I've just started with iOS development and I have downloaded xCode 4.2 which uses the iOS 5 SDK. What I'm concerned about is that I've had a heap of trouble trying to run a vanilla brand new project on my iPhone 3G to test compatibility (i.e. the armv6 problem) It's fairly obvious that Apple want us to be building for the newer hardware, but we hold responsibility when it comes to supporting users of our applications who are still running older hardware. Especially if you want your application to be in as many hands as possible.

For instance, ARC sounds like a god send, but it won't work on iOS versions below 4.3. I've also had good experiences with Storyboards until I tried to install the app on a pre iOS5 device.

Are there any good information sources out there for best practices when trying to support all iOS devices? Is this simply a case of users having to fess up that it's time to get a new iPhone? Or is it a case of developing with the older SDKs until we're just chasing the long tail? Is this question already chasing the long tail?

It's reminiscent in a subtle way of browser standards support fragmentation. Look forward to hearing other peoples thoughts.

Community
  • 1
  • 1
Chris
  • 7,996
  • 11
  • 66
  • 98
  • This is a real problem. The best, and by best I mean the one Apple recommends, is to always push forward and drop support for older OSes. You can see that in their own apps. iMovie and all of iWork are now iOS 5 only. I disagree with this, if only because there's money to be made supporting the millions of older devices out there. But this is why they don't make it easy... they don't care. There are ways to work around it, but you're going to have to keep devices on hand to test, and avoid upgrading them. It's a real burden on smaller developers, for sure. – Kenny Winker Oct 19 '11 at 00:21
  • Absolutely. Do you know of any information sources that suggest the trending decline of older devices? – Chris Oct 19 '11 at 01:21

1 Answers1

2

You can lower the Deployment Target in your target's summary settings to support a lesser OS version. The caveat is that the code still compiles to the latest SDK you have installed. This means that you cannot call any methods or use any functionality released after the lowest OS version you wish to support. If you do plan to use new methods for devices that are running a newer version of the OS, you need to surround them with

if ([<class> respondsToSelector:@selector(methodName)] {

}

to make sure the method will run only on devices that support it.

James
  • 2,346
  • 1
  • 16
  • 18
  • 1
    Apple has some documentation of similar techniques here http://developer.apple.com/library/mac/#documentation/DeveloperTools/Conceptual/cross_development/Using/using.html – Kenny Winker Oct 19 '11 at 00:50