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

Discussion in 'iOS Programming' started by seepel, Jan 10, 2012.

  1. seepel, Jan 10, 2012
    Last edited: Jan 10, 2012

    seepel macrumors 6502

    seepel

    Joined:
    Dec 22, 2009
    #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.
     
  2. ArtOfWarfare macrumors 604

    ArtOfWarfare

    Joined:
    Nov 26, 2007
    #2
    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.
     
  3. seepel thread starter macrumors 6502

    seepel

    Joined:
    Dec 22, 2009
    #3
    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).
     
  4. North Bronson macrumors 6502

    Joined:
    Oct 31, 2007
    Location:
    San José
    #4
    Do any of these links still work?
     
  5. firewood macrumors 604

    Joined:
    Jul 29, 2003
    Location:
    Silicon Valley
    #5
    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.
     
  6. seepel thread starter macrumors 6502

    seepel

    Joined:
    Dec 22, 2009
    #6
    Great link I'll have to hold onto those images.

    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.
     
  7. PhoneyDeveloper macrumors 68030

    PhoneyDeveloper

    Joined:
    Sep 2, 2008
  8. seepel thread starter macrumors 6502

    seepel

    Joined:
    Dec 22, 2009
    #8
    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.
     
  9. firewood macrumors 604

    Joined:
    Jul 29, 2003
    Location:
    Silicon Valley
    #9
    A symbolicated crash dump is the fastest way to see if an unsupported API was causing a particular crash.
     
  10. seepel thread starter macrumors 6502

    seepel

    Joined:
    Dec 22, 2009
  11. seepel thread starter macrumors 6502

    seepel

    Joined:
    Dec 22, 2009
    #11
    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!
     

Share This Page