I have an NSPopUpButton of type pulldown with the following structure:
NSMenu
|- NSMenu ---> item-1 // can't read value from sender
|- item-2 // can read sender
|- item-3 // can read sender
When selecting anything off the first menu (item-2 or item-3), the
value of 'sender' prints fine and I can compare it using the code
below. But if I select the first item which is an NSMenu and leads to
another NSMenu with it's item (item-1), then the method menuReader: is
called, but sender does not hold any value at all, it's just blank.
Anyone understand what I'm doing wrong here?
- (IBAction) menuReader:(id) sender
{
NSLog(@"sender %@", [sender titleOfSelectedItem]);
if ([[sender titleOfSelectedItem] isEqualToString:@"item1"]) {
// ...
}
else if ([[sender titleOfSelectedItem] isEqualToString:@"item2"]) {
// ...
}
else if ([[sender titleOfSelectedItem] isEqualToString:@"item3"]) {
// ...
}
}
Any help much appreciated.
_______________________________________________
Cocoa-dev mailing list ([email protected])
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com
This email sent to [email protected]