Adopted by: NSObject (informal protocol)
Declared in: AppKit/NSComboBoxCell.h
The NSComboBoxCellDataSource category declares the methods that an NSComboBoxCell uses to access the contents of its data source object. The combo box cell determines how many items to display by sending a numberOfItemsInComboBoxCell: message, and accesses individual values with the comboBoxCell:objectValueForItemAtIndex: method. Incremental searches-performed when a user types into the combo box's text field while the pop-up list is displayed-are performed by sending comboBoxCell:indexOfItemWithStringValue: messages to the combo box cell's data source.
The NSComboBoxCell treats objects provided by its data source as values to be displayed in the combo box's pop-up list. If these objects aren't of common value classes-such as NSString, NSNumber, and so on-you'll need to create a custom NSFormatter to display them. See the NSFormatter class specification for more information.
When an NSComboBoxCellDataSource is asked to supply a data item, the NSComboBoxCell that sends the request is provided as a parameter. This allows a single data source object to manage several sets of data, choosing the appropriate set based on the identify of the NSComboBoxCell that sends the message.
- (unsigned int)comboBoxCell:(NSComboBoxCell
*)aComboBoxCell indexOfItemWithStringValue:(NSString
*)aString
- (id)comboBoxCell:(NSComboBoxCell
*)aComboBoxCell objectValueForItemAtIndex:(int)index
- (int)numberOfItemsInComboBoxCell:(NSComboBoxCell
*)aComboBoxCell