【发布时间】:2012-01-04 16:51:09
【问题描述】:
我想通过我的 tableview 的行跳转到我的 detailview。
将数据从 tableview 传递到 detailview 工作正常。 传递 indexpath.row 也可以正常工作。
在详细视图中,我可以更改行的索引路径,并通过返回到 tableview 来正确选择更改的行。
我的问题是我无法在详细视图中查看新选定行的数据。
我希望你明白我想要做什么:)
例如在邮件应用程序中:我想按下“下一步”按钮并获取相关数据。
下一个函数:
- (IBAction)nextRow:(id) sender {
NSLog(@"nextBtn");
TableRotateViewController *parent = (TableRotateViewController *)self.parentViewController;
NSIndexPath *actualIndexPath = detailselectedRow;
NSIndexPath * newIndexPath = [NSIndexPath indexPathForRow:actualIndexPath.row+1 inSection:actualIndexPath.section];
if([parent.view.subviews objectAtIndex:0]) {
UIView * subview = (UIView *) [parent.view.subviews objectAtIndex:0];
UITableView *tView = (UITableView *) subview;
[tView selectRowAtIndexPath:newIndexPath animated:YES scrollPosition:UITableViewScrollPositionMiddle];
[tView.delegate tableView:tView didSelectRowAtIndexPath:newIndexPath];
}
}
这是我的示例应用程序,以便更好地了解我所做的 jet:http://www.file-upload.net/download-3896312/TableRotate.zip.html
【问题讨论】:
标签: ios uitableview row next detailview