• Where to remove observer for NSNotification?

  •  iOS NSNotificationCenter 移除通知带来的crash

  在dealloc方法中移除通知观察者带来crash

    NSNotificationCenter中的通知消息已经发出,而观察者对象子线程释放,也就是抛送通知消息的线程和观察者对象子线程释放的线程不一致时,存在crash风险,原因是NSNotificationCenter不是线程安全的。

    解决办法:尽早移除通知 或者保证释放和抛送通知在同一个线程。

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-11
  • 2021-09-27
猜你喜欢
  • 2022-12-23
  • 2022-01-05
  • 2022-12-23
  • 2021-10-01
  • 2022-12-23
  • 2022-12-23
  • 2021-08-17
相关资源
相似解决方案