[英]Refreshing NSTreeController from CoreData
I am developing a cocoa app which has NSOutlineView which is binded to NSTreeController with CoreData integration. 我正在开发具有NSOutlineView的可可应用,该应用通过CoreData集成绑定到NSTreeController。
For some purposes, I am deleting some of the nodes in NSTreeController by 为了某些目的,我删除了NSTreeController中的某些节点,方法是
MyTreeController.removeObjectAtArrangedObjectIndexPath(someIndexPath)
But than, I need to reload the NSTreeController back from CoreData by using the current binding. 但是,相比之下,我需要使用当前绑定从CoreData重新加载NSTreeController。 However, I couldn't find a solution because NSTreeController has no reload data function.
但是,我找不到解决方案,因为NSTreeController没有重载数据功能。
Any help or a workaround will be appreciated. 任何帮助或解决方法将不胜感激。
Calling -removeObjectAtArrangedObjectIndexPath
against a NSTreeController
that is associated with Core Data will remove the object from Core Data. 对与Core Data关联的
NSTreeController
调用-removeObjectAtArrangedObjectIndexPath
会将对象从Core Data中删除。
Calling -fetch:
afterwards is going to cause the data to return, it has been deleted. 调用
-fetch:
之后将导致数据返回,它已被删除。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.