您好,我正在用leanCloud开发项目。当我集成ChatKit-OC,使用单聊功能,每次返回都会崩溃,告诉我kvo没有移除,具体代码我定位到了, 于是我在setViewWillDisappearBlock的回调里面去移除了。虽然不崩溃了,但是每次我聊天的时候都会发送2条内容。希望能得到您的帮助,感谢。
[self addObserver:self forKeyPath:@"loadingMoreMessage" options:NSKeyValueObservingOptionNew context:LCCKBaseConversationViewControllerRefreshContext];
这是崩溃日志
2019-11-25 17:08:29.421374+0800 Zgzh-iOS[540:50917] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'An instance 0x131de1600 of class LCCKConversationViewController was deallocated while key value observers were still registered with it. Current observation info: <NSKeyValueObservationInfo 0x173a34ba0> (
<NSKeyValueObservance 0x17025d0a0: Observer: 0x131de1600, Key path: loadingMoreMessage, Options: <New: YES, Old: NO, Prior: NO> Context: 0x101254b10, Property: 0x17025d0d0>
)'