User External Data Source.
[mEmailListBox setUsesDataSource:YES];
[mEmailListBox setDataSource:self];
/*
If you use setDataSource: before setUsesDataSource:, setDataSource: throws an exception.
*/
- (NSInteger)numberOfItemsInComboBox:(NSComboBox *)aComboBox;
{
return [DatSource count];//DatSource NSArray
}
- (id)comboBox:(NSComboBox *)aComboBox objectValueForItemAtIndex:(NSInteger)index;
{
return DatSource[index];
}
Take a look at Combo Box Programming Topics
You can also load data in background with the help of noteNumberOfItemsChanged
and reloadData
methods