所以,我想事件处理程序附加到小部件,我放在用我的iPhone应用程序:编程连接事件处理程序
addTarget:action:forControlEvents
我添加一个UISegmentedControl在Interface Builder这是通过@property seg
暴露在的loadView,我有:
- (void)loadView { [ super loadView ] ; //k after that attach our own event handlers [ seg addTarget:seg action:@selector(sliderEventIB) forControlEvents:UIControlEventAllEvents ]; }
sliderEventIB,只是告诉我们感觉事件:
-(IBAction)sliderEventIB:(id)sender forEvent:(UIEvent*)event { puts("I feel you joanna") ; }
,但我得到的错误是
ViewControllersTest[6744:207] *** -[UISegmentedControl sliderEventIB]: unrecognized selector sent to instance 0x3b21b30
任何想法,它不喜欢这里?