how to create id sender button inside button in iphone
<p>I am new to iPhone programming.I have taken one button inside that, I have created another button programmatically with id sender ,I want to use multiple buttons inside that id sender button using tags.Now I did some coding but it is showing some Exception.When i am giving <code>[self somemethodname:(id)sender];</code> here I am getting problem, actually <code>[self playOrPause]</code> this one I have used in another button.How to slove this please any body tell me.
Thanks</p>

<pre><code>- (void)playOrPause
{
    UIButton *aa = [UIButton buttonWithType:UIButtonTypeCustom]; 
    [aa addTarget:self action:@selector(play:)forControlEvents:UIControlEventTouchUpInside];
    NSLog(@"hi iam 2");
    [self play:(id)sender];
}
-(void)play:(id)sender
{
 UIButton *instanceButton = (UIButton*)sender;
        instanceButton.tag++;
        if (instanceButton.tag == 1) 
        {
            NSLog(@"hi");
        } else if (instanceButton.tag == 2) 
        {
            NSLog(@"hi2");
        } 

  }
</code></pre>
