我的NSTreeController设置核心数据的父级属性而不是子级属性。NSTreeController没有设置核心数据的子属性
我有这样
Item
title (string)
isLeaf (boolean,readonly)
parent -> Group (inverse children)
Group (parent entity Item)
children -> Item (inverse parent)
Leaf (parent entity Item)
核心数据模型,我再与NSOutlineView显示它并使用NSTreeController。我使用方法 - [NSTreeController insertObject:atArrangedObjectIndexPath:]尝试插入Leaf's,叶子父级属性设置正确,但父级Group.children属性仍然设置为零。
当我运行该项目,我得到的控制台
Warning: <NSTreeController: 0x7fcd93c19d20>[object class: NSMutableDictionary] childrenKeyPath cannot be nil. To eliminate this log message, set the childrenKeyPath attribute in Interface Builder
即使childrenKeyPath在界面生成器设置以下警告,为什么它使用的NSMutableDictionary时,我有一个NSManagedObject子类SavedItem,SavedGroup和SavedLeaf。我已经下载了几个例子,但我不明白他们在做什么,我不是。