0
我有一个自定义单元格一个UIButton我编程方式添加:定制电池输出的UIButton不调用didSelectRowAtIndexPath方法
UIButton *tag = [[UIButton alloc] init];
[tag addTarget:self action:@selector(buttonClicked:) forControlEvents:UIControlEventTouchUpInside];
这是我的按钮处理程序:
-(void)buttonClicked:(id)sender
{
UIButton *clickedButton= (UIButton*)sender;
NSLog(@"Button tapped!", nil);
self.tagTapped = YES;
self.tagSelected = clickedButton.titleLabel.text;
}
按钮水龙头已注册,但我的主视图控制器didSelectRowAtIndexPath没有被调用。点击单元格中的其他地方,但点击按钮不会调用该方法。有任何想法吗?
谢谢,我只是做了一个委托方法来处理UIButton的调用。 – Endokun 2013-02-12 14:23:29