Simple NSPopupButton question...hopefully

Discussion in 'Mac Programming' started by fuhrj, Aug 7, 2009.

  1. fuhrj macrumors newbie

    Aug 7, 2009
    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 :eek:
  2. ritsard macrumors regular


    Jun 18, 2009
    SF Bay Area, CA
    How does your selector for the button look like?
  3. fuhrj thread starter macrumors newbie

    Aug 7, 2009
    Thanks for the response. I ended up bagging this method and had added the items directly through IB. :eek:

Share This Page