关于 KVO 引用计数
About the KVO reference count
当我使用
addObserver:forKeyPath:options:context:
在这个方法中,观察者在ARC中是强引用还是弱引用?
对这个问题有什么想法吗?
查看文档here
Note: The key-value observing addObserver:forKeyPath:options:context:
method does not maintain strong references to the observing object,
the observed objects, or the context. You should ensure that you
maintain strong references to the observing, and observed, objects,
and the context as necessary.
简而言之:该方法不维护对观察者的强引用。
当我使用
addObserver:forKeyPath:options:context:
在这个方法中,观察者在ARC中是强引用还是弱引用?
对这个问题有什么想法吗?
查看文档here
Note: The key-value observing addObserver:forKeyPath:options:context: method does not maintain strong references to the observing object, the observed objects, or the context. You should ensure that you maintain strong references to the observing, and observed, objects, and the context as necessary.
简而言之:该方法不维护对观察者的强引用。