我想通过我的 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];
}
}
这是我的示例应用程序,可以更好地了解我所做的工作:http ://www.file-upload.net/download-3896312/TableRotate.zip.html