0

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.

emreoktem
  • 2,409
  • 20
  • 36
  • The reload data function is called `fetch:`. – Willeke Jun 08 '16 at 11:51
  • @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 Jun 08 '16 at 13:25
  • Are the objects removed from the context? – Willeke Jun 08 '16 at 20:14

1 Answers1

2

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.

Marcus S. Zarra
  • 46,571
  • 9
  • 101
  • 182