My UITableViewController has the class name of SettingsViewController. It contains a property linked to a UITableViewCell called signOutCell.
Why does this not recognize if a user has touched the signOutCell? It is inside SettingsViewController.m?
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
if ([touches containsObject:signOutCell])
{
[self triggerActionSheetConfirmation];
}
}
I placed
NSLog(@"Received touch");
before the if statement, but it never got called. Is touchesBegan:withEvent: never getting called when anything is touched in this TableViewController?
How can I get a simple tap in a UITableViewCell to call the method triggerActionSheetConfirmation?
Use the
UITableViewDelegatemethodtableView:didDeselectRowAtIndexPath:. In that method get the cell of the row clicked via theUITableViewmethodcellForRowAtIndexPath. Then use anifstatement to compare the cell with theUITableViewoutlet property you created. Then run your method if it evaluates to that outlet.