iPhone Development - EXC_BAD_ACCESS error with no stack trace

后端 未结 6 1285
情书的邮戳
情书的邮戳 2021-01-02 21:45

Here\'s my case: I have a table view showing contacts. Add button in the navigation bar is used to load another view for data entry. This new view has images in table header

6条回答
  •  遥遥无期
    2021-01-02 22:15

    Although this is most often a result of mismanaged memory, it can happen for other reasons (and be harder to debug than simply turning on NSZombieEnabled). For example, if you fail to supply the correct number of arguments to a format string (i.e. while debugging another problem with NSLog), you could end up with no stack trace even with all debugging arguments enabled. Luckily, you can use GDB within Xcode to restore the stack trace to a previous state.

    In the GDB console you should see the instruction that crashed your program. Locate the last successful return instruction before the one that failed. It should look something like this:

    je    0x986cef35 
    

    Note the hex value and execute the following in GDB:

    set $eip = 0x986cef35
    stepi
    where
    

    You should (hopefully) have a more informative stack trace now.

    Source (same as the link above)

提交回复
热议问题