在我的ViewController中我有一个barButton,我为它创建了一个监听器,如下面发布的代码所示。
在运行时,当我单击barButton时,条形图中的日志消息按钮操作方法onBarButtonPressed
doe snot display。
请告诉我如何为条形按钮创建动作监听器?
码
#import "ViewController.h"
@interface ViewController ()
@end
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a
nib.
[self collectValues];
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
- (IBAction)onBarButtonPressed:(id)sender {
NSLog(@"CLICKED");
}
- (void) collectValues {
self.textFieldValueToDispatch;
}
@end
图片