Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

seepel

macrumors 6502
Original poster
Dec 22, 2009
471
1
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:
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.
 
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).
 
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.
 
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.
 
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.
 
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.
 
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!
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.