iOS objc_msgSend crash, with no report or warning given

為{幸葍}努か 提交于 2019-12-03 11:05:22
Kreiri
  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.

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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!