nscombobox

Cocoa-Bindings : Bind NSComboBox selection to a field in NSObjectController

Hello, in my application I have a NSObjectController bound to all controls on the user interface. This works fine so far. The only problem I have is binding the selection of an NSComboBox to the same ObjectController. As far as I found out today the value of a ComboBox is always a string so the field in the Class of the OBjectController...

Unable to retrieve selected index from NSComboBox

Im trying to get the selected index of a NSComboBox that has a datasource by using indexOfSelectedItem. [combobox setUsesDataSource:YES]; [combobox setDataSource:dataSource]; [combobox selectItemAtIndex:1]; int idx =[combobox indexOfSelectedItem]; idx will always returns -1; Getting the same results even when defining a internal list...

NSComboBox - Obtaining selected information and NSComboBoxDataSource

For the life of me, I am being continually stumped with NSComboBox. I created an object that conforms the NSComboBoxDataSource protocol, and implemented: - (NSInteger)numberOfItemsInComboBox:(NSComboBox *)aComboBox; - (id)comboBox:(NSComboBox *)aComboBox objectValueForItemAtIndex:(NSInteger)index; I set the instance of my NSComboBox...

Get NSComboBox to work like an HTML Combo

Is it possible to have the values displayed in an NSComboBox be different from what is retrieved with objectValueOfSelectedItem? So, it will display an object's string name but it's int recordId is returned instead of the string name? Other than using selected index and getting it from the source array, of course... ...

What are the correct bindings for an NSComboBox for use with Core Data

Imagine if you will a Core Data app with two entities (Employee, and Department). Employees have a to-one relationship with department (department) and the inverse is a to-many relationship (employees). In the UI you can select individual Employee entities and edit the details in a detail area (there are of course other attributes and th...

NSComboBox not returning correct data

I'm adding strings to a NSComboBox using -addItemObjectWithValue, and the items are appearing when the application is run. However, right after adding the items, if I check the -numberOfItems, I get 1, even though there are more than that. From there, any data I try I pull back out is wrong. I'm adding the items as part of -awakeFromN...

How to set value of NSComboBox by KVC?

I have several NSComboBoxes created in Interface Builder, and one created programmatically. The NSComboBoxes created in Interface Builder are perfect. I have their Value bound to the Shared User Default Controller, and when their view is opened they are sitting there with the correct value. Importantly, this value is shown as "normal"...

Converting an NSComboBox to and NSTextField Easily

I have an NSComboBox and I was wondering if there is an easy way to convert it to an ordinary NSTextField? Considering NSCombBox is a subclass of NSTextField, I would think there is an easy way to turn this on/off but I can't figure it out. ...

NOOB Problems with getting results from code (more specificly with NSComboBox)

I know that this is probably a simple question but here is what I'm racking my brain to figure this out: I know that this: - (id)comboBox:(NSComboBox *)aComboBox objectValueForItemAtIndex:(NSInteger)index { return [midiModelContents objectAtIndex:index]; } will return the item at the index provided. My question is, what code do I n...