max*_*sme 1 objective-c uitableview ios
我有两个viewcontrollers:ViewControllerA和ViewControllerB
ViewControllerA有一个有很多细胞的UITable.每个单元格都有一个按钮.当您单击单元格按钮时,它会导航到ViewControllerB这样:
[[cell nav] setTag:indexPath.row];
[cell.nav addTarget:self action:@selector(naviguate:) forControlEvents:UIControlEventTouchUpInside];
cell.nav.tag=indexPath.row;
Run Code Online (Sandbox Code Playgroud)
nav按钮在哪里.而naviguate包含[self performSegueWithIdentifier:@"link" sender: sender];其中的环节是从赛格瑞ViewControllerA到ViewControllerB
当我然后导航回ViewControllerB使用performSegue它回到表的顶部!有没有办法保持ViewControllerA与我离开的位置相同的位置?
你不想做圆形的细分.您每次都会创建一个新的ViewControllerA.
您应该使用dismissViewController:animated:或popViewControllerAnimated:返回A代替.ViewControllerA将与以前一样,因为它是相同的VC而不是重新创建的VC.
| 归档时间: |
|
| 查看次数: |
55 次 |
| 最近记录: |