MacOS NSComBox 使用

1、需要 选择“uses data source”,不然datasource是不启作用

MacOS NSComBox 使用_第1张图片



2、代理

// Combo box data source methods

// ==========================================================

- (NSInteger)numberOfItemsInComboBox:(NSComboBox *)aComboBox {

return 2;

}

- (id)comboBox:(NSComboBox *)aComboBox objectValueForItemAtIndex:(NSInteger)loc {

return [NSString stringWithFormat:@"%ld",loc];

}

你可能感兴趣的:(MacOS NSComBox 使用)