0
votes

I am developing a cocoa app which has NSOutlineView which is binded to NSTreeController with CoreData integration.

For some purposes, I am deleting some of the nodes in NSTreeController by

MyTreeController.removeObjectAtArrangedObjectIndexPath(someIndexPath)

But than, I need to reload the NSTreeController back from CoreData by using the current binding. However, I couldn't find a solution because NSTreeController has no reload data function.

Any help or a workaround will be appreciated.

1
The reload data function is called fetch:. - Willeke
@Willeke thanks for replying. I tried fetch as MyTreeontroller.fetch(nil) after using MyTreeController.removeObjectAtArrangedObjectIndexPath(someIndexPath) commad but the removed items were not received back from the context. - emreoktem
Are the objects removed from the context? - Willeke

1 Answers

2
votes

Calling -removeObjectAtArrangedObjectIndexPath against a NSTreeController that is associated with Core Data will remove the object from Core Data.

Calling -fetch: afterwards is going to cause the data to return, it has been deleted.