1、需要 選擇“uses data source”,不然datasource是不啟作用
2、代理
// Combo box data source methods
// ==========================================================
- (NSInteger)numberOfItemsInComboBox:(NSComboBox *)aComboBox {
return 2;
}
- (id)comboBox:(NSComboBox *)aComboBox objectValueForItemAtIndex:(NSInteger)loc {
return [NSString stringWithFormat:@"%ld",loc];
}