Does a KVO observer add a memory leak to itself?

In nsobject, you have the "keyPath" property that you want to observe yourself, and you use

[self addObserver:self forKeyPath:keyPath options:NSKeyValueObservingOptionNew context:nil]; 

Does the above line cause a hold cycle?

I present this question because I wanted to know if this was a viable alternative to rewriting a lot of setter functions.

+7
memory-leaks objective-c key-value-observing retain-cycle kvc
source share
1 answer

From docs :

Neither the receiver nor anObserver are saved.

+7
source share

All Articles