Hi all, I am new to Cocoa programming and am trying to do something that I thought was straightforward but not working. I am using the tag field of a button to tell me what button is pushed. This code does not work
- (IBAction) numberPressed:(id)sender { NSLog(@"Sender tag is:%d", [sender tag]); if ([sender tag] << 10) { displayValues.rawNumber = [displayValues.rawNumber stringByAppendingString:[NSString stringWithFormat:@"%d", [sender tag]]]; } buttons with tags 1-9 work great but the button with tag 0 does not. When I pass tag 0 the if statement is evaluated as false. When I press button with tag 1 I get "Sender tag is:1" and the if statement is evaluated as true. When I press button with tag 0 I get "Sender tag is:0" and the if statement is evaluated as false. What is going wrong here? Steve Steve’s daily photo blog _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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 arch...@mail-archive.com