【发布时间】:2014-03-29 04:38:00
【问题描述】:
我使用的是分段的 tableView。如果我单击 tableview 总是将 indexpath 0 传递给详细视图控制器。如果我单击第二行但 indexpath 传递总是传递 0。
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
if ([segue.identifier isEqualToString:@"toNext"]) {
detailTableViewController *detailVC = [segue destinationViewController];
[detailVC setkMessageDict:(NSDictionary*)[nArray objectAtIndex:[self.mytableView indexPathForSelectedRow].section]];
}
代码有什么问题?
【问题讨论】:
-
有多少个部分?也许你的意思是行而不是部分。
-
我有 4 个部分..总是返回 0。@KudoCC
-
@gagarwal 你能举个例子吗?
-
@gagarwal 请用我的代码编辑
标签: ios objective-c uitableview ios7 uistoryboardsegue