美文网首页
KVO 防crash KVO_IS_RETAINING_ALL

KVO 防crash KVO_IS_RETAINING_ALL

作者: 东方诗空 | 来源:发表于2020-11-20 15:09 被阅读0次

    crash 原因:
    对观察者的炒作没有成对添加和移除

    解决方案:
    防crash 做好保护,采用本地成对存储添加和删除做判断防crash

    Crashed: com.apple.main-thread
    0  libobjc.A.dylib                0x180a5e7e8 object_isClass + 16
    1  Foundation                     0x181f013e8 KVO_IS_RETAINING_ALL_OBSERVERS_OF_THIS_OBJECT_IF_IT_CRASHES_AN_OBSERVER_WAS_OVERRELEASED_OR_SMASHED + 68
    2  Foundation                     0x181eff8ec NSKeyValueWillChangeWithPerThreadPendingNotifications + 300
    3  QuartzCore                     0x18555a6dc CAAnimation_setter(CAAnimation*, unsigned int, _CAValueType, void const*) + 156
    4  QuartzCore                     0x18555d388 -[CAPropertyAnimation setKeyPath:] + 32
    

    相关文章

      网友评论

          本文标题:KVO 防crash KVO_IS_RETAINING_ALL

          本文链接:https://www.haomeiwen.com/subject/rxsivktx.html