title: KVO: Cannot remove an observer
body: <p>In my interface I have an <code>NSTextField</code> who's <code>value</code> is bound to an <code>NSArrayController's</code> <code>selection.selectedType.title</code>. All of the <code>NSArrayController's</code> objects are custom objects each with two methods:</p>
  
  <pre><code>- (MYType *)selectedType;
  - (void)setSelectedType: (MYType *)type;
  </code></pre>
  
  <p>The <strong>don't</strong> have an iVar <code>selectedType</code>. However, they do have an iVar holding all <code>MYType</code> objects. The code boils down to this:</p>
  
  <pre><code>- (MYType *)selectedType
  {
     if (someIndex == 0)
          return [types objectAtIndex: 0];
      else
          return [self typeWithIndex: someIndex];
  }
  
  - (void)setSelectedType: (MYType *)type
  {
       someIndex = [type index];  
  }
  </code></pre>
  
  <p><code>MYType</code> objects got a <code>NSString *title</code> iVar with a corresponding <code>@property</code> and <code>synthesize</code>.</p>
  
  <p>Whenever I call <code>setSelectedType:</code>, the changes are immediately visible in the <code>NSTextField</code> and everything seems to work but I get a log message saying:</p>
  
  <blockquote>
    <p>Cannot remove an observer NSArrayController 0x141160 for the key
    path "selectedType.title" from MYType 0x1a4830, most
    likely because the value for the key "selectedType" has
    changed without an appropriate KVO notification being sent. Check the
    KVO-compliance of the MYType class.</p>
  </blockquote>
  
  <p>I tried encapsulating the <code>setSelectedType:</code> method with <code>willChangeValueForKey:</code> and <code>didChangeValueForKey:</code> and then I still got a log message but a different one:</p>
  
  <blockquote>
    <p>Cannot remove an observer NSKeyValueObservance 0x1c7570 for the key
    path "title" from MYType 0x1a4be0 because it is not registered as an
    observer.</p>
  </blockquote>