I am porting my iOS app to the Mac, and want to set up an NSTreeController to manage a hierarchy of entities. There are two distinct NSManagedObject types in this hierarchy, Group and Item, which have a one-to-many relationship (one Group to many Items). However I am having trouble setting up the NSTreeController; I'm getting an error message:
[<NSManagedObject 0x10029c410> valueForUndefinedKey:]: the entity Item is not key value coding-compliant for the key "items".
It seems that NSTreeController is intended to be set up with one type of NSManagedObject, whose children refers to itself, and that having the children be a different kind of object does not work. Is this correct? If so, what do I need to do to rectify this, while keeping the new data model able to migrate properly from the old data model using lightweight migration? If I am indeed able to accomplish the NSTreeObject with two different kinds of NSManagedObjects, how should I set it up?