Adopted by: NSObject (Informal Protocol)
Declared in:
- AppKit/NSComboBox.h
The NSComboBoxDataSource category declares the methods that an NSComboBox uses to access the contents of its data source object. The combo box determines how many items to display by sending a numberOfItemsInComboBox: message, and accesses individual values with the comboBox: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 comboBox:indexOfItemWithStringValue: messages to the combo box's data source.
The NSComboBox 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.
- (NSString *)comboBox:(NSComboBox
*)aComboBox
completedString:(NSString *)aString
- (unsigned int)comboBox:(NSComboBox
*)aComboBox
indexOfItemWithStringValue:(NSString
*)aString
NSNotFound
if no item matches.
This method is optional; if you don't provide an implementation
for this method, no searches occur.- (id)comboBox:(NSComboBox
*)aComboBox
objectValueForItemAtIndex:(int)index
- (int)numberOfItemsInComboBox:(NSComboBox
*)aComboBox