iOS Question Application crashes on resume

Discussion in 'iOS Questions' started by nwhitfield, Aug 8, 2018.

  1. nwhitfield

    nwhitfield Active Member Licensed User

    I've got a fairly complex application that mostly works fine, except that from time to time when resuming, it crashes - the last screen visible appears briefly, and then it quits and the user's dumped back to the home screen of their phone.

    I've never managed to reproduce this in debug mode. On my test phone I've tried using iReleaseLogger, logging messages at each stage during Application_Active, but nothing appears, so it seems as if something it killing the app before it even gets to that stage, or so quickly that the log output isn't flushed and never makes it onto the network.

    Some times, it works perfectly, and the app resumes, logging everything. I can't determine any pattern regarding how long it takes before the crash happens, or whether other apps have been used in the meantime - sometimes just switching away for a short time causes it, other times it can be in the background for several minutes and resume just fine.

    I don't have a local mac with Xcode, so I can't check crash logs using that. Is there any other way to track down what is happening in a situation like this?
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    iReleaseLogger can actually cause such issues.

    Are you doing anything with sockets?
     
  3. nwhitfield

    nwhitfield Active Member Licensed User

    Yes, I am. There's a routine called in Application_Active that makes an http request to my server, to check connectivity, plus various other API requests.

    Is that likely to be the issue?
     
  4. Erel

    Erel Administrator Staff Member Licensed User

    iHttpUtils2 or low level sockets with iNetwork?
     
  5. nwhitfield

    nwhitfield Active Member Licensed User

    The former. I'm not a complete masochist :)
     
  6. Erel

    Erel Administrator Staff Member Licensed User

    It is something else...

    - Add log messages to Application_Foreground and see whether you can read them.
    - Create a "log" sub that logs the message and also writes it to a file. Open an outputstream, write the string and close it.
     
    nwhitfield likes this.
  7. nwhitfield

    nwhitfield Active Member Licensed User

    Thanks. Will give that a go
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice