RemoveObserver: forKeyPath: in dealloc

If my instance observes some property of another object, should I call removeObserver: forKeyPath: in dealloc?

+5
source share
2 answers

Yes

... if there is no more suitable time in execution.

Observers are stored as unreached links. If you cannot register, this may result in the sending of your exempted copy.

+10
source

-removeObserver: forKeyPath: , [NSObject dealloc], , -dealloc .
. .
question2

+3

All Articles