Hi guys, I'm learning object-c with cocoa. I was studying this example and I a question has appeared in my mind. Follow the code:
I didn't understand why I have to use "selectedCell". Why only senderes?
Don't the code identifies that I'm selecting a option when I click on one item from the Pop button?
Cheers
Code:
-(IBAction)findSelectedButton: (id)senderes
{
[COLOR="Red"]NSPopUpButtonCell *selCell = [senderes selectedCell];[/COLOR]
NSLog(@"Selected cell is %d", selCell.tag);
NSLog(@"Title is %@", selCell.title);
NSInteger index = [senderes indexOfSelectedItem];
NSLog(@"Selected item is %i", index);
}
Don't the code identifies that I'm selecting a option when I click on one item from the Pop button?
Cheers
Last edited by a moderator: