Search code examples
iosobjective-cmemory-managementasihttprequestxcode-instruments

how to find and fix the cause of the crash


I submited an app to the app store and it was rejected due to:

"We found that your app crashed on iPhone 5 running iOS 6.1.2, which is not in compliance with the App Store Review Guidelines.

Your app crashed when we:

when the user taps to sign into the app, a crash is produced.

This occurred when your app was used:

  • On Wi-Fi
  • On cellular network

Your app may encounter this issue if it is using too much memory. To learn more about iOS memory usage and how to track memory usage and leaks, please see the Memory Usage Performance Guidelines."

I couldn't trigger the crash again on my side. I profiled my app with the allocations instrument, and saw that that my live bytes never exceeded 12MB. With the leaks instrument I figured out that I have a few leaks (all in 3rd party sources), but they are very minor and shouldn't have cause the app to crash.. I have no clue what to do..

  1. Did the app really crash due to using too much memory?
  2. Could there be another reason?
  3. How should I approach this and fix the problem?

EDIT - attached the crash log

Check out this&that, it seems like using ASIHTTPRequest framework is causing the crash some how, but only on ad-hoc or distribution builds, which makes debugging it more of a headache. Is it really the cause? Should I switch to AFNetworking instead?


Solution

  • Yes, you should switch to AFNetworking, because ASIHTTPRequest is not supported any more.

    To debug this issue, try to set Optimization Level to Fastest, Smalles [-Os]. This is usually the reason, why debug and release code behaves differently.