EXC_BAD_ACCESS in a random place

Discussion in 'iOS Programming' started by gokilltime, Feb 13, 2009.

  1. gokilltime macrumors newbie

    Joined:
    Feb 13, 2009
    #1
    Hey guys,
    I'm completely stuck.
    I'm finishing a quite large iphone project and only a few dialogs left, everything else works fine. And this is a problem!
    Ok, so I've got "settings" button in the main menu in my app, and when you tap it, a new dialog (class inherited from UIView) should appear. The thing is when you tap it, the app crashes _sometimes_. Sometimes it works well, the dialog appears as I want to and works pretty fine.
    It crashes in a random place, with random stack, and the only thing the debugger says is Program received signal: “EXC_BAD_ACCESS”.
    I've rewritten the dialog completely from scratch, it had no effect.
    Yes, I have tried GuardMalloc - nothing, NSZombies - nothing.
    Maybe you have any ideas?
     
  2. xsmasher macrumors regular

    xsmasher

    Joined:
    Jul 18, 2008
    #2
    When it crashes go to Run > Debugger. The top-left column should be the "stack trace" of what was running at the time of the crash. Look down the list until you see one of your methods, and click on it. With luck, the debugger will highlight the last line of that method that was run before the crash.

    A bug that's hard to reproduce is hard to fix - but at least you'll know where to start.
     
  3. gokilltime thread starter macrumors newbie

    Joined:
    Feb 13, 2009
    #3
    yes, i've done that. the problem is that it crashes in a random place: sometimes [UILabel alloc] causes EXC_BAD_ACCESS, sometimes it is [UIImageView initWithFrame:], sometimes it is free(...), the debugger is almost no help(
     

Share This Page