O'Reilly logo

Cocoa in a Nutshell by James Duncan Davidson, Michael Beam

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

NSComboBoxCellDataSource — Mac OS X 10.0

Synopsis

NSComboBox controls rely on data source objects to provide the contents of the combo box. This informal protocol provides the interface for NSComboBoxCell data source objects to implement. It declares methods that not only provide the contents of the combo box list, but support autocompletion behavior (where a string is returned from the data source that matches a partially completed string typed into the combo box field). At a minimum, data source objects must implement the methods comboBoxCell:objectValueForItemAtIndex: and numberOfItemsInComboBoxCell:.

@interface NSObject (NSComboBoxCellDataSource)
                                  // Instance Methods
   - (int)numberOfItemsInComboBoxCell:(NSComboBoxCell *)comboBoxCell;
   - (id)comboBoxCell:(NSComboBoxCell *)aComboBoxCell 
                                 objectValueForItemAtIndex:(int)index;
   - (unsigned int)comboBoxCell:(NSComboBoxCell *)aComboBoxCell  
                                 indexOfItemWithStringValue:(NSString *)string;
   - (NSString *)comboBoxCell:(NSComboBoxCell *)aComboBoxCell 
                                 completedString:(NSString *)uncompletedString;
@end

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required