简体   繁体   English

如何处理iOS中多次调用一个屏幕的导航?

[英]How to handle the navigation of one screen calling multiple times in iOS?

iPad application: iPad应用程序:
I have a one screen called profile screen which is showing my information and on the same screen at the bottom I am showing list of persons (only name and photo). 我有一个名为个人资料屏幕的屏幕,该屏幕显示我的信息,并且在底部的同一屏幕上,我显示的是人员列表(仅姓名和照片)。 I can click on any of the person photo and it shows me the same profile screen with selected person information. 我可以单击任何人的照片,它会显示与所选人信息相同的个人资料屏幕。 From there I can further go to the details of another person and so on. 从那里,我可以进一步转到其他人的详细信息,依此类推。 And this can go to any hierarchy (Similar to facebook connections). 这可以进入任何层次结构(类似于Facebook连接)。 I am using storyboard. 我正在使用情节提要。

My problem is: 我的问题是:
1. How to navigate/call to same screen with different profile information? 1.如何使用不同的个人资料信息导航/调用同一屏幕?
2. Back button on the navigation bar should take me back to the previous profile from where I came. 2.导航栏上的“后退”按钮应将我带回到我来自的位置。

If the back button is going to take you back to the previous profile that you were just viewing, you should just create a new controller of the current type, set the data to the next user, and push it to the nav controller. 如果后退按钮将带您回到刚才查看的上一个配置文件,则应仅创建当前类型的新控制器,将数据设置为下一个用户,然后将其推送到导航控制器。

MyViewController *vc = [[MyViewController alloc] initWithNibName:@"MyViewController"];
vc.personDetails = details;
[self.navigationController pushViewController:vc animated:YES];

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM