IPhone动态创建控件手动添加事件

UIButton *actionButton = [[UIButton alloc] initWithFrame:CGRectMake(20.0, 160.0, 280.0, 38.0)];
[actionButton addTarget:self action:@selector(decisionButtonPressed) forControlEvents:UIControlEventTouchUpInside];

- (void)decisionButtonPressed{

}
 

你可能感兴趣的:(iPhone)