PDA

View Full Version : Simple NSPopupButton question...hopefully




fuhrj
Aug 7, 2009, 03:09 PM
In IB, I created a NSPopupButton for the purpose of giving a list of options to the user. I removed the default item 1, item 2, etc. from NSMenu.

In my controller, I populate the control with the following code:


NSMutableArray *statusList = [[NSMutableArray alloc] init];

[statusList addObject:@"Open"];
[statusList addObject:@"Closed"];
[statusList addObject:@"On hold"];

[status addItemsWithTitles:statusList];


The control populates fine and I can see my three items. However, when I try to select an item, it always pops back to the first item in the list.

What would cause this? Am I binding incorrectly?

Many thanks :o



ritsard
Aug 10, 2009, 12:50 PM
How does your selector for the button look like?

fuhrj
Aug 10, 2009, 01:56 PM
How does your selector for the button look like?

Thanks for the response. I ended up bagging this method and had added the items directly through IB. :o