我有一个模态显示的 UITableViewController。当用户单击任何单元格时,我需要捕获该选择并关闭 View Controller 。奇怪的是,无法识别第一个被点击的单元格。当用户单击另一个单元格时,它会被识别并且一切都按预期进行。显然,我需要第一次点击才能被识别。我做错了什么?
- (void) tableView:(UITableView *)tableView didDeselectRowAtIndexPath:(NSIndexPath *)indexPath
{
NSLog(@"cell clicked");
// capture user selection and return to previous screen
[self dismissViewControllerAnimated:YES completion:nil];
}
最佳答案
您正在使用 tableView:didDeselectRowAtIndexPath:
而不是 tableview:didSelectRowAtIndexPath:
;)
关于ios - Modal UITableView 无法识别第一次点击,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20962879/