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?
Asked
Active
Viewed 422 times
1
-
2Run on iOS5 simulator/device – Anil Varghese Jun 07 '13 at 10:28
-
1I will pimp my own previous answer -> http://stackoverflow.com/questions/12632834/get-xcode-4-5-to-warn-about-new-api-calls/12633309#12633309 – borrrden Jun 07 '13 at 10:31
1 Answers
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
-
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
-
-