One way is to use the array controller’s selectedObjects method. Since it returns an array, you’ll want to get the object at index 0 or the last object if you want a single row’s data.
NSDictionary has a method, allValues(), that creates a new array from the dictionary, but the order of the items will be undefined. Will that work for you?
well I plan on restoring these values to different fields in the app. So I will need to know either by record name or item count what item of the record I am working with so I know where it needs to go.
I’m not sure that I understand what you want then. The result you got is a dictionary with all the info you need – you can use valueForKey to get a value for a particular key, and then put that in wherever field you want.
This is giving me the correct info I need. Is there a better way to do this?
on getCurrentRow_(sender)
set SelectedRecord to thelookupArrayController's selectedObjects()'s lastObject()
set theSelectedOrderID to valueForKey_("OrderIDcolumn") of SelectedRecord
log theSelectedOrderID
end getCurrentRow_
After Edit: There is another way to do this with no code at all, and that’s with bindings, if I’m understanding what you want to do. In your table you would have a column bound to the array controller’s arrangedObjects.CSREmailcolumn for instance. If you wanted that data to appear in a text field, you could bind that text field’s value to array controller’s selection.CSREmailcolumn – that would populate that text field with whatever is the value of the CSREmailcolumn column of the selected row.