Trigger core data save after tableview text change

I use in my OSX App a Core Data Api.
It create’s an sqlite database.
I’ve connected the core data to my NSArrayController bij bindings.
The NSArrayController is connect to an NSTableView by bindings.

All the data is show correct.
But when i change some data in the > NSTableView the data is not directly saved to my database.
I have tryed bij de function: > func tableView(_ tableView: NSTableView, objectValueFor tableColumn: NSTableColumn?, row: Int) → Any? {
Bud it looks like it does not trigger anything.

Can anyone help me with this problem.

When i change any values in my NSTableView the data is directly saved to my Database.

Thanks to you all.

@erich_snijder. Thanks very much for your question, and my apologies for the delayed response.

Your problem sounds like it could easily be solved using NSFetchedResultsController.

NSFetchedResultsController is meant to work directly with Core Data via the UITableView, so this should be the way to go.

We also provide a video course that shows how to use NSFetchedResultsController in the link below :slight_smile: :

https://videos.raywenderlich.com/courses/98-beginning-core-data/lessons/12

I hope this helps!

All the best!