title: Core Data: Strange bindings error on re-opening a document. Help?
body: <p>I have been building a core data application to administrate some data and I've been stumped by a bug that indicates my objects aren't KVO compliant. However, I haven't modified the default KVO compliance of the NSManagedObject, and now I'm left scratching my head.</p>
  
  <p>The area of the application that the bug is affecting is that of creating some categories and organising some items that will live inside those categories. The items may exist in multiple categories and the items AND categories view order can be set by the user. Simple stuff.</p>
  
  <p>To better visualise this, the key pieces of the core data model I have set-up are displayed below. I've simplified the naming and attributes of the entities somewhat:</p>
  
  <pre><code>Category &lt;---------&gt;&gt; CategoryItem &lt;&lt;---------&gt; Item
  --------              ------------              --------
  name                  viewPosition              name
  viewPosition                                    description
  </code></pre>
  
  <p>This model is connected to two ArrayControllers in interface builder, one for categories and one for categoryitems. The categoryitems content set is set to the category array controller via a selection.categoryItems binding. These array controllers feed two table views. The content of the category items table is bound to the CategoryItem A.C controller via arrangedObjects.item.name.</p>
  
  <p>This all works perfectly and I'm dragging and dropping and ordering both Items and Categories to my hearts desire.</p>
  
  <p>Except for one strange case.</p>
  
  <p>Whenever I create a category with exactly one item, then save, if I then re-open the document I am presented with the following error:</p>
  
  <p>Cannot remove an observer <code>&lt;NSTableBinder 0x1627f670&gt;</code> for the key path "item.name" from <code>&lt;NSManagedObject 0x16273380&gt;</code>, most likely because the value for the key "item" has changed without an appropriate KVO notification being sent. Check the KVO-compliance of the NSManagedObject class.</p>
  
  <p>After that the interface seems to fall apart and the application becomes unusable. I've searched the web and all I can uncover is that this points to KVC non-compliance. But I'm using standard, barely modified, Apple classes here.</p>
  
  <p>The bug ISN'T raised when I bind to the viewPosition of the CategoryItem only. i.e. via arrangedObjects.viewPosition instead of arrangedObjects.item.name. It's as if the relationship between categoryitem and item isn't ready at the point the table initially observes (and only if there is one item).</p>
  
  <p>Has anyone else encountered this? Can anyone think of a possible workaround?</p>