Instance Method インスタンスメソッド

removeObserver:forKeyPath:

Stops the observer object from receiving change notifications for the property specified by the key path relative to the object receiving this message.

Declaration 宣言

- (void)removeObserver:(NSObject *)observer 
            forKeyPath:(NSString *)keyPath;

Parameters パラメータ

observer

The object to remove as an observer. オブザーバとして取り除くことになるオブジェクト。

keyPath

A key-path, relative to the object receiving this message, for which observer is registered to receive KVO change notifications.

Discussion 解説

It is an error to call removeObserver:forKeyPath: for an object that has not previously been registered as an observer.

Be sure to invoke this method (or removeObserver:forKeyPath:context:) before any object specified in addObserver:forKeyPath:options:context: is deallocated.

See Also 参照

Registering for Observation