[英]SWIFT - How to use performseguewithidentifier from a tableview in tableviewcell
[英]Navigating from TableViewCell to another View with performSegueWithIdentifier
我想通过单元格的路径从tableviewcell导航到另一个视图。 我正在使用以下代码:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
if (indexPath == 0) {
[self performSegueWithIdentifier:@"segueToKnutene" sender:self];
}
如您可能理解的那样,这是行不通的。 请记住,我对xcode和Objective-c还是比较陌生。
在我的脑海中,如果按下/释放表格视图中的顶部单元格,则会对另一视图执行搜索。 这也是我想要做的。
NSIndexPath
由row
和section
。 所以你可能想使用
if (indexPath.section == 0 && indexPath.row == 0)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.