Name

NSComboBoxDataSource — Mac OS X 10.0

Synopsis

This informal protocol provides methods for a class to implement to act as a data source for NSComboBox objects. This protocol 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 comboBox:objectValueForItemAtIndex: and numberOfItemsInComboBox:.

@interface NSObject (NSComboBoxDataSource)
                                  // Instance Methods
   - (int)numberOfItemsInComboBox:(NSComboBox *)aComboBox;
   - (id)comboBox:(NSComboBox *)aComboBox 
                                 objectValueForItemAtIndex:(int)index;
   - (unsigned int)comboBox:(NSComboBox *)aComboBox 
                                 indexOfItemWithStringValue:(NSString *)string;
   - (NSString *)comboBox:(NSComboBox *)aComboBox 
                                 completedString:(NSString *)string;
@end

Get Cocoa in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.