I have a tableView and I create a Button on one cell.
UIButton *deleteGroupButton = [UIButton buttonWithType:UIButtonTypeCustom];
[deleteGroupButton setFrame:CGRectMake(218, 12, 40, 60)];
[deleteGroupButton addTarget:self action:@selector(deleteGroupButtonClicked:) forControlEvents:UIControlEventTouchUpInside];
When I click to button, an Exception occur with that message:
"Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[Group deleteGroup:]: unrecognized selector sent to instance 0x5a8afc0' "
And that is my deleteGroupButtonClicked method
- (void) deleteGroupButtonClicked: (id) sender {
Groups *tmpGroups = [[Group alloc] init];
NSInteger tmp = appDelegate.selectedGroupId;
[tmpGroups deleteGroup:tmp];
[tmpGroups release];
}