Simple NSPopupButton question...hopefully

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

  1. fuhrj macrumors newbie

    Joined:
    Aug 7, 2009
    #1
    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:

    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

    ritsard

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

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

Share This Page