1

I had a problem with the latest release of my app, where iOS 5 users said it was crashing. I quickly discovered the problem to be with using an iOS 6 method. I didn't realise this method was a new one. I was wondering if there was a way to quickly check my code (without doing it method-by-method) to make sure all code is compatible with previous versions of iOS?

jscs
  • 63,694
  • 13
  • 151
  • 195
Andrew
  • 15,935
  • 28
  • 121
  • 203

1 Answers1

1

You should test your app on iPhone/iPad 5.0 simulator. I think they are not available by default XCode 4.6 onwards, but you can download them from: Preferences > Downloads > Components.

Edit: It seems like XCode doesn't warn about new APIs in your code. There a workaround described in this answer: Get xcode 4.5 to warn about new API calls -

#define __AVAILABILITY_TOO_NEW __attribute__((deprecated("TOO NEW!"))) __attribute__((weak_import))

#if __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_6_0
#undef __AVAILABILITY_INTERNAL__IPHONE_6_0
#define __AVAILABILITY_INTERNAL__IPHONE_6_0 __AVAILABILITY_TOO_NEW
#endif
Community
  • 1
  • 1
maroux
  • 3,764
  • 3
  • 23
  • 32
  • I've done that now - it'd just be nice to know without having to test out every possible scenario on a previous version of iOS. – Andrew Jun 07 '13 at 10:28
  • Ah, I see your problem - you need to set `Base SDK` to `5.0` (or the minimum version you want to support). The compiler will then throw errors (or warnings?) for unsupported APIs. – maroux Jun 07 '13 at 10:31
  • If only it were that easy ;) – borrrden Jun 07 '13 at 10:32
  • Just saw your answer, will delete this and get off SO now. – maroux Jun 07 '13 at 10:33