Strange Crash on Device and Debugging

Discussion in 'iOS Programming' started by sleaver, Aug 2, 2010.

  1. sleaver macrumors member

    Jul 21, 2010
    I took a leap of faith yesterday and put my first app on my phone. It's nothing special or spectacular but I'm happy as it's the first time I've developed on an Apple device.

    Anyway, I have a UIWebview in a UIViewController class and after testing on the device last night everything was fine, including the UIWebView with no crashes in sight. Took it to work today and was showing someone else who is interested in mobile development and got to the UIWebView, then touch the 'Back' button on the navigation controller and it crashed :eek::mad::confused: and again each time I tried it thinking 'Well it didn't do this last night'.

    So, I got home and tried it again and guess what, it was fine :confused:. Same phone, just a different wireless connection and me thinking why!!!

    Has anyone had this sort of behavior in the past where it's fine on one connection but not another? All I do is push the class with the UIWebView and then the back button should just remove it , no special code in the .m file and I just have the goBack/goForward/stop outlets connected to UIBarButtonItem's!

    I have included the crash log below but I have no idea how to understand it so any help would be greatful :D

  2. dejo Moderator


    Staff Member

    Sep 2, 2004
    The Centennial State
    This looks troublesome:
    You get no "may not respond to" warning from compiling the code?
  3. PhoneyDeveloper macrumors 68040


    Sep 2, 2008
    You probably have a memory management bug.

    Look at the device console in the Organizer window after the crash. You're looking for the info that's printed out related to the assertion failure. You would usually see this in the debugger console but since there's no debugger it's in the device console. Unfortunately the device console only holds about 256 lines so you may have lost it.

    Run Build and Analyze, it may pick up the problem. Run the app with NSZombies turned on in the debugger and you may hit the same bug.
  4. sleaver thread starter macrumors member

    Jul 21, 2010
    That line stood out for me too!

    Nope, I don't get any of those errors but I did notice tonight I had a "does not implement delegate". But can something like that make it crash in one geographical location and not another?
  5. sleaver thread starter macrumors member

    Jul 21, 2010
    I'll try the organiser tomorrow. Hopefully if I make it crash just before I leave work and don't touch the phone until I'm home I'll catch it. Do the lines get time stamped to make it easier to spot?

    Is there a quick explination of NSZombies and how to use them? Again would that catch something that happens in one geographical location and not another? Can different wireless connections cause memory leaks?
  6. PhoneyDeveloper macrumors 68040


    Sep 2, 2008
    There will be timestamps on every line in the device console.

    Just type NSZombie into the search box in the Xcode developer documentation. Or search on google. It's widely known.

    I wouldn't worry too much about that. You have a memory management bug. It probably happens every time you run but you just haven't run into it when debugging.


    Regarding the does not respond to selector assertion failure, looking at the stack trace it's most likely that that error doesn't happen because your code is calling a method that doesn't exist. It's happening because of an under-retain bug in your code. There's a small chance that it's happing because of a bad typecast in your code but I doubt it.
  7. sleaver thread starter macrumors member

    Jul 21, 2010
    So I was already to get the crash to happen so I could look in the debug log and the thing wouldn't crash!

Share This Page