Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

rethish

macrumors member
Original poster
Oct 16, 2008
41
0
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.
 

rethish

macrumors member
Original poster
Oct 16, 2008
41
0
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.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.