1

When I use

addObserver:forKeyPath:options:context: 

In this method, will the observer be a strong reference or just a weak reference in ARC?

Any ideas for this problematic?

Benjamin W.
  • 46,058
  • 19
  • 106
  • 116
Ruibin.Chow
  • 83
  • 1
  • 6

1 Answers1

3

See the documentation 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.

In short: The method does not maintain a strong reference to the observer.

DAXaholic
  • 33,312
  • 6
  • 76
  • 74