0
votes

i have a core-data app with an entity that has

hostname username password

(all NSString) for attributes.

Then I'v linked up the core data model, the array controller, and table view with add and remove buttons.

Basically, at this stage I have written about zero lines of code and the app works great.

(This is simple version of Chapter 11 from Cocoa Programming for Mac OS X, Hillegass)

The question is how do I (programmatically) get the selected entity/object as seen in the tableView from managedObjectContext or the array controller?

1

1 Answers

1
votes

You use the NSArrayController's selectedObjectsmethod. That returns an array of the objects whose data was selected in the UI. You can bind to it or call the method directly.