【发布时间】:2011-11-30 06:55:04
【问题描述】:
抱歉标题不清楚。我希望能够将 IBAction 方法添加到我通过以下方式添加的按钮:
(.h 类)
{
UIButton *button;
}
-(IBAction)ButtonReleased:(id)sender
(.m 类)
{
-(IBAction)ButtonReleased:(id)sender
{
//Actions done by button pointer
}
- (void)viewDidLoad
{
[super viewDidLoad];
[PlayButton setFrame:CGRectMake(10, 10, 100, 50)];
[PlayButton setTitle:@"PlayButton" forState:UIControlStateNormal];
[self.view addSubview:PlayButton];
}
}
问题是,如何将 UIButton 按钮操作(例如,TouchUpInside)连接到 ButtonReleased 方法。
【问题讨论】:
标签: ios xcode cocoa-touch uibutton ibaction