Search code examples
ios9nsnotificationcenterobservers

Removing NSNotificationCenter Observers from iOS 9


From iOS 9 it is no longer necessary for an NSNotificationCenter observer to un-register itself when being deallocated, it's done automatically.

Does this apply to NSKeyValueObserving too?


Solution

  • Yes, it's true for KVO as well.

    Keep in mind that you should unregister key-value observers if you're targetting below iOS 9.