1
votes

I'm pretty new to Cocoa, and I have an NSComboBox which I'm populating with an NSComboBoxDataSource. So far so good, but the one thing I haven't been able to figure out is what type of objects can be stored. I've had success with strings, but I'd like to be able to store more info than what is displayed. I've tried storing a custom object which represents what is being listed (clients), but of course nothing is displayed.

1

1 Answers

1
votes

You can save any object, in your model.

But for display purpose string will be good. And based on the selection of the string value, you can fetch the entire object ( it may be in arrays or dictionaries). Then anywhere in your gui you can display all the propeties.

As, when you nslog dictionary or array having objects, you see only its memory locations not the values inside the object. You have to again break them to display. So is the case here.