相关疑难解决方法(0)

如何在tableView中使用Seque查找tapped按钮的indexPath

我有一个UITableView使用原型单元格.

细胞具有UIButton显示UIViewController(模态)使用的细胞Segue.

我的问题是:我如何将IndexPath单元格传递给第二个视图控制器

- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {

    if ([segue.identifier isEqualToString:@"showGamerDetail"]) {

            //its not worked:
            NSIndexPath *indexPath = [self._tableView indexPathForSelectedRow];
            nDetailViewController *destinationViewController = segue.destinationViewController;
            destinationViewController.selectedRowTitle = [gamers objectAtIndex:indexPath.row];

        destinationViewController.indexPath = indexPath;
        destinationViewController.delegate = self;
    }
Run Code Online (Sandbox Code Playgroud)

uitableview ios

5
推荐指数
1
解决办法
1万
查看次数

标签 统计

ios ×1

uitableview ×1