I have a UIButton in a custom cell that I programmatically added:
UIButton *tag = [[UIButton alloc] init];
[tag addTarget:self action:@selector(buttonClicked:) forControlEvents:UIControlEventTouchUpInside];
And this is my button handler:
-(void)buttonClicked:(id)sender
{
UIButton *clickedButton= (UIButton*)sender;
NSLog(@"Button tapped!", nil);
self.tagTapped = YES;
self.tagSelected = clickedButton.titleLabel.text;
}
The button tap is registered, but didSelectRowAtIndexPath in my master view controller is not being called. Tapping elsewhere in the cell works, but tapping on the button does not call the method. Any ideas?