Objective C IBOutlets

Posted by Alan on Stack Overflow See other posts from Stack Overflow or by Alan
Published on 2009-03-07T16:24:04Z Indexed on 2010/06/15 2:32 UTC
Read the original article Hit count: 325

Filed under:
|
|

In cases where multiple buttons call an IBOutlet, can the IBOutlet determine which button was pressed?

edit:

All fixed and wired up. key point: Object ID is not sender tag! Tag is a standalone value on the first page of the attributes.

- (IBAction)buttonPressed:(id)sender
{
    switch ( [sender tag] )
    {
        case 109:
            NSLog(@"Button 1");
            break;

        case 108:
            NSLog(@"Button 2");
            break;
    }
}

© Stack Overflow or respective owner

Related posts about iphone

Related posts about objective-c