gpt4 book ai didi

iphone - 在新 TableView 中显示选定的行

转载 作者:行者123 更新时间:2023-11-28 23:10:17 25 4
gpt4 key购买 nike

我有一个普通的表格 View ,其中显示了带有 plist 内容的几个部分和行。每当选择一行时,我想在新的分组 TableView 中显示该行的内容(因此是完全相同的行)。关于如何实现这一点有什么想法吗?

编辑:现在有这段代码:

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
NSDictionary *selectedMatch = [self.matchesArray objectAtIndex:indexPath.row];

NSLog(@"%@", [selectedMatch description]);
NSLog(@"IndexPath: %@", [indexPath description]);

DetailTableViewController *dvController = [[DetailTableViewController alloc] initWithNibName:@"DetailViewController" bundle:[NSBundle mainBundle]];
dvController.selectedMatch = selectedMatch;
[dvController release];
dvController = nil;
}

最佳答案

我想当您通过点击选择您的行时,您将以模态方式推送或呈现一个新的 tableviewController。因此,只需将此 newTableviewController 子类化即可接收 indexPath ...与您选择的行对应的相同 indexPath。因此,在 newTableviewController 中,您可以将 selectRowAtIndexPath:animated:scrollPosition: 发送到您的 newTableView,以显示与您之前表格的行相对应的新行的选择。

希望这对您有所帮助。

关于iphone - 在新 TableView 中显示选定的行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8466603/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com