iOS App Crashes on iOS 4 (Tracking down iOS 5 code)

seepel

macrumors 6502
Original poster
Dec 22, 2009
471
0
I have an app that I am developing and I have a user that reports that the app crashes on iOS 4. I don't have any devices that have iOS 4 on them and I suspect I have inadvertently used some code that is only available on iOS 5. Does anyone have any good tricks for tracking something like this down?

EDIT: I should also mention that the code in question is probably hanging out in the MediaPlayer Framework, so testing in the simulator won't help.
 
Last edited:

ArtOfWarfare

macrumors G3
Nov 26, 2007
8,579
4,019
Isn't there some setting that establishes what the minimum iOS version is? Shouldn't warnings/errors appear during compile saying that the code isn't safe for the minimum iOS version?

Maybe I'm wrong.
 

seepel

macrumors 6502
Original poster
Dec 22, 2009
471
0
Isn't there some setting that establishes what the minimum iOS version is? Shouldn't warnings/errors appear during compile saying that the code isn't safe for the minimum iOS version?

Maybe I'm wrong.
If only that were true. I have set the minimum iOS version set to 4.0, but as the SDK is iOS 5 it won't give any warnings or errors (nor do I even have the iOS 4 SDK available).
 

firewood

macrumors 604
Jul 29, 2003
7,660
887
Silicon Valley
One basic rule is not to set the Deployment Target lower than you can find an actual device running it to test your app with. If you can't find (borrow, find an user on-line for an Ad Hoc beta, etc.) an iOS 4 device, set your deployment target to 5.x.

There is no way using any version of Xcode, the SDK, or the Simulator (even old versions) to tell for sure if your app is compatible. Only by device testing.
 

seepel

macrumors 6502
Original poster
Dec 22, 2009
471
0
Do any of these links still work?
Great link I'll have to hold onto those images.

One basic rule is not to set the Deployment Target lower than you can find an actual device running it to test your app with. If you can't find (borrow, find an user on-line for an Ad Hoc beta, etc.) an iOS 4 device, set your deployment target to 5.x.

There is no way using any version of Xcode, the SDK, or the Simulator (even old versions) to tell for sure if your app is compatible. Only by device testing.
I do have users with iOS 4 on ad hoc builds. I was just looking for a way to track down the offending code without having a device in my hands (short of double checking every function against the docs). Your point is well taken however, and I've already been tracking eBay for a cheap 2nd gen iPod Touch.
 

seepel

macrumors 6502
Original poster
Dec 22, 2009
471
0
Did you get crash logs from the user?
Not yet, rather than asking for help on this specific bug I was wondering if there was a nice little trick anyone used to track down this general problem. That problem being, targeting an older OS version and inadvertently including new code.

Incidentally I did stumble on the bug, it wasn't directly in the MediaPlayer framework, but amidst a lot of MediaPlayer code. It turns out I had some generated Core Data classes using scalers for numerical values, which of course iOS 4 doesn't know how to do with @dynamic.
 

firewood

macrumors 604
Jul 29, 2003
7,660
887
Silicon Valley
Not yet, rather than asking for help on this specific bug I was wondering if there was a nice little trick anyone used to track down this general problem.
A symbolicated crash dump is the fastest way to see if an unsupported API was causing a particular crash.
 

seepel

macrumors 6502
Original poster
Dec 22, 2009
471
0
And almost a year later I now have problems with iOS 6 code in an app that I want to support iOS 5. A google search pretty much only turned up this thread. I wish there was a better way to deal with this!