doubt on NSComboBox ?

Discussion in 'Mac Programming' started by rethish, Dec 9, 2008.

  1. rethish macrumors member

    Joined:
    Oct 16, 2008
    #1
    Hai all,

    In my application I need to perform different task , when each item in the combo box is clicked.

    I tried ,but it didn't worked.

    the code :

    -(IBAction)comboselect:(id)sender
    {


    if([[combo1 itemObjectValueAtIndex:1] isEqualToString:mad:"A"] )
    {

    [txt uppercaseWord:sender];


    }

    else if([[combo1 itemObjectValueAtIndex:1] isEqualToString:mad:"a"])
    {

    [txt lowercaseWord:sender];

    }


    }


    here txt is an instance of NSTextView .


    the problem is that ,when i click each item of the combobox , only one task is repeated (in this case: uppercase ).

    I think, its bcoz of the wrong syntax for selecting the item from the combobox.

    please help to solve the problem

    thankyou.
     
  2. Sayer macrumors 6502a

    Sayer

    Joined:
    Jan 4, 2002
    Location:
    Austin, TX
  3. rethish thread starter macrumors member

    Joined:
    Oct 16, 2008
    #3
    thank you for the response.

    I tried it , but i couldn't get it.


    when I tried [[combo1 objectValueOfSelectedItem] isEqualToString:mad:"a"] instead of

    [[combo1 itemObjectValueAtIndex:1] isEqualToString:mad:"a"] it worked.

    thankyou.
     

Share This Page