Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cocoa: Core Data + NSTableView

I have a core data app set up, and everything is working pretty well. But there is one little problem. When I insert a new object into my entity I have it go to my NSTableViewCell, where I can edit it to the text I want, but there's one little issue, I can edit the cell, but I can't deselect it to save it to core data, it's stuck in edit mode and the only way I can get out of it is by quitting the application, AND it doesn't save the new name I just gave it in my cell.

like image 236
Matt S. Avatar asked Apr 26 '26 08:04

Matt S.


1 Answers

This kind of functionality is covered in the Core Data tutorials provided by Apple. It will get you to make use of the NSArrayController which is a very helpful class for synchronising the view (NSTableView) and the model (Core Data).

I believe this is a great place to see how this works: http://developer.apple.com/cocoa/coredatatutorial/index.html

Hope that helps.

like image 179
Tom Duckering Avatar answered Apr 28 '26 11:04

Tom Duckering



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!