Coding for KVO

There are three steps involved in setting up KVO, and one cleanup step when we have finished observing:

  1. We need to prepare our classes for KVO.
  2. We need to let the system know when we wish to observe an object, and which change(s) we wish to observe.
  3. We need to override NSObject's method that handles the change notification.

And when we are done, the last step:

  1. Let the system know that we have finished observing the object (either because we no longer need to observe changes to properties of the object, or because the observing object is to be deallocated).

Once we have done that, we will have created a fully KVO--compliant class and implemented the observation code in another class.