On more than one occasion I’ve been stumped by some new functionality from a newer iOS version crashing when used on an older iOS device. You know, the kind of problem that you’re supposed to catch yourself with a NSStringFromClass or respondsToSelector.
The recently released Deploymate app scans your Xcode projects for such problems and flags them. This proves that such an analysis is possible and can be implemented. The developer of Deploymate confided that he hesitated to release for a long while since he feared that Apple might put exactly this functionality into Xcode. But they never did, so he created the app.
This Radar is my documented suggestion to Apple to finally add such functionality into Xcode. Worst case they should acquire the technology employed by Deploymate and add that. But I am quite certain that LLVM’s analysis capabilities should be able to put to this use as well.
Filed as rdar://13436964 and on OpenRadar.
Xcode: Provide Warnings if App might Crash on devices with previous iOS version
Compiling with “Latest SDK” allows developers to make use of new functionality in the latest SDKs, but if the deployment target allows for execution on earlier iOS versions then there are many scenarios where usage of new functionality or even constants might lead to a crash.
The IDE should detect scenarios where the developer forgot add the appropriate checks if functionality exists (e.g. respondsToSelector) and point out code where a crash is inevitable.
That such functionality is possible is proven by a newly released app called Deploymate (http://www.deploymateapp.com) which scans an Xcode project and flags such problems.
From personal experience I can say that even though we developers KNOW about having to check for these scenarios and also test on older supported iOS versions it DOES happen and the result is always embarrassment for having shipped an app that crashes. By baking such a tool into the Xcode IDE it would save us this embarrassment.
Categories: Bug Reports