IOS笔记
1。button控件添加事件监听
//button控件添加事件监听
[button addTarget:方法对象 action:@select(方法[:(可选)]) forControlEvents:事件触发方式];
如:
[button addTarget:self action:@select(buttonClicked) forControlEvents:UIControlEventTouchUpInside];
[button addTarget:self action:@select(buttonClicked:) forControlEvents:UIControlEventTouchUpInside];
- (void) buttonClicked (UIButton *) button{
NSLog("你点击了按钮!");
}