プログラムで NSPopUpButton を作成し、選択肢の配列を作成しました。個々の配列の選択肢ごとに setAction を作成するにはどうすればよいですか? ありがとう!
NSRect buttonRect = NSMakeRect(1705, 145, 78, 50);
//Button Array. When I pick the choice it closes the diologue box
NSArray *newArray;
NSString *color1 = @"Blue Color";
NSString *color2 = @"Green Color";
NSString *color3 = @"Clear Color";
newArray = [NSArray arrayWithObjects: color1, color2, color3, nil];
NSPopUpButton *button = [[NSPopUpButton alloc] initWithFrame:buttonRect pullsDown:YES];
[self addSubview:button];
[button addItemsWithTitles:newArray];
//want my action for each individual string
[button setAction:@selector(changeFilterColor)];
-(void) changeFilterColor
{
NSLog(@"colorChanged");
}