iOS objc_msgSend crash, with no report or warning given

前端 未结 2 1843
独厮守ぢ
独厮守ぢ 2021-02-13 18:56

I am testing my app out, pushing it pretty hard, and I\'m getting it to crash (black screen, image doesn\'t save, drops back to springboard). However, I get no crash reports lo

相关标签:
2条回答
  • 2021-02-13 19:43

    sometimes that happens when you set an object as an observer for notifications, like

    [[NSNotificationCenter defaultCenter] addObserver //details
    

    and don't remove it from the observers list when it's released.
    the system tries to send a message to it, and the app crashes because it's not there.

    try adding

    [[NSNotificationCenter defaultCenter] removeObserver:self];
    

    in the dealloc function.
    (even if you're working with arc, create a dealloc function, and write that in it).

    good luck

    0 讨论(0)
  • 2021-02-13 20:02
    1. If you suspect that you are overreleasing something, try running your app with NSZombie enabled. (how to enable NSZombie)

    2. You can set exception breakpoint to print backtrace in console.

    0 讨论(0)
提交回复
热议问题