我有一些执行 segue 的单元格,但我想要一个单元格来注销当前用户。如何将此操作设置为单个单元格?
谢谢,蒂姆。
最佳答案
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
// User selected a row, so check if it's the logout row or not
if (indexPath.row == logoutRowIndex) {
// Logout
[self logout];
} else {
// Perform segue
[self performSegueWithIdentifier:@"segueIdentifier"];
}
}
关于ios - TableView - 选择单元格时的操作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28180442/