【发布时间】:2013-09-17 14:54:59
【问题描述】:
当我尝试将孩子插入我的 NSTreeController 时,为什么会出现此崩溃错误?
NSTreeController *tree = [NSTreeController new];
NSTreeNode *node1 = [NSTreeNode treeNodeWithRepresentedObject:@{ @"type": @"shirt" }];
// The below method causes mysterious crash
[tree insertObject:node1 atArrangedObjectIndexPath:[NSIndexPath indexPathWithIndex:0]];
Xcode 说:
* 由于未捕获的异常“NSInternalInconsistencyException”而终止应用程序,原因:“[对象类:NSMutableDictionary] 无法执行操作,因为 childrenKeyPath 为 nil” *
为什么会导致这个错误?什么是 childrenKeyPath,我为什么需要它(我没有使用界面生成器)?
【问题讨论】:
标签: objective-c macos crash osx-lion nstreecontroller