UIButton 用法
1 .h
-(IBAction) buttonClick:(id)sender;
2 .m
-(IBAction) buttonClick:(id)sender
{
UIButton *button=(UIButton *)sender; //UIButton *button[[UIButton alloc] init]];
NSString *title=[NSString stringWithFormat:@"Button tag is %d",button.tag];
NSString *message=[button currentTile];
UIAlertView *alert=[[UIAlertView alloc] initWithTitle:title message:message delegate:self cancelButtonTitle:@"Ok" otherButtonTitles:nil];
[alert Show];
[alert release];
}
3 run result: