English 中文(简体)
• 如何把已经装满的UI号回来?
原标题:How to segue back to a UIViewController that s already loaded?

我在故事片上看到,有一个州可以采取某种行动。 但是,为了采取这一行动,必须把用户挂在册。 如果用户在电离层或电离层外出,则按电离层进行电离层测试。 无声望推向控制器。 还有一个与第一个观察控制器连接起来的地震,这样,如果日志成功,用户就可以搬离。 观察控制器位于导航控制器内。

问题在于,返回问题本身正在装上全新观察控制器的全新案例,而没有提及大事,因此,我最后拿着空的接口元素和2份观察控制器的记忆。

How can I get back to the original instance of the view controller?

最佳回答

假设你使用“<条码>push<>/code>,你就是指你正在使用<条码>查询代码>。

[self.navigationController popToRootViewControllerAnimated:YES];

UIViewController *prevVC = [self.navigationController.viewControllers objectAtIndex:<n>];
[self.navigationController popToViewController:prevVC animated:YES];

达到以下特定水平:<代码><n>为水平。

[self.navigationController popViewControllerAnimated:YES];

如果你只是想把一个层次的舱位放在一边,那就能够支持航行。

问题回答

各位不应利用先头控制器回头,而应利用与先头控制器相关的活动,而应放弃目前的观察控制器(如果其轮式是代号),或从导航控制器(如果其排气是推导的),而以前的控制器将自动显示。

For example, if the modal segue that goes back was being performed when you pressed a button on your login screen, you delete the segue from the storyboard and on the touch up inside event of the button you link with your action that, upon successful login will call:

 [self dismissViewControllerAnimated:YES completion:nil];

在故事板上,你将右边点击 but子,把在发送活动中的触角拖到观察控制器现场的第一对手。 这将执行当你进行先期过渡时所执行的逆向过渡。 你们可以为此使用一种模式,无需使用导航控制器。

If you pushed the login view onto the navigation controller, then you have to pop it from the stack (if going back to the previous view). Use one of these:

    [[self navigationController] popViewControllerAnimated:YES];  // goes back to previous view
[[self navigationController] popToViewController: myViewControllerAfterLogin animated:YES]; // goes back to specific view on stack. 
[[self navigationController] popToRootViewControllerAnimated:YES]; // goes back to first view on the stack

transition然过渡应扭转gue头上所用的过渡类型,如果你不赞成这种观点,就会 cur倒。

如果你利用先令回来,那么你就应当利用一种不易的 se。 关于如何使用静风排气的详细信息载于rel=“nofollow noreferer”>。

吸入是正确的,值得点击他的链接。

守则似乎从 Apple果的事例中走过了几句,而且更加灵活。 我有三处情况,但只有一只习俗观察家。 我不想打脚。 进入随后的现场是来自纽特州的gues。 我在基数控制器的档案中添加了这一条:

- (IBAction)unwindForSegue:(UIStoryboardSegue *)unwindSegue towardsViewController:(UIViewController *)subsequentVC{}

然后,在第三场,我控制从一个 but子拖到一个 exit子,并选择了 un行动。 现在,它从第3场回落到第2场,而不需要打听器。





相关问题
List Contents of Directory in a UITableView

I am trying to list the contents of Ringtones directory in a TableView, however, I am only getting the last file in the directory in ALL cells, instead of file per cell. This is my code: - (...

iPhone NSUserDefaults persistance difficulty

In my app i have a bunch of data i store in the NSUserdefaults. This information consists of an NSObject (Object1) with NSStrings and NSNumbers and also 2 instances of yet another object (Object2). ...

Writing a masked image to disk as a PNG file

Basically I m downloading images off of a webserver and then caching them to the disk, but before I do so I want to mask them. I m using the masking code everyone seems to point at which can be found ...

Resize UIImage with aspect ratio?

I m using this code to resize an image on the iPhone: CGRect screenRect = CGRectMake(0, 0, 320.0, 480.0); UIGraphicsBeginImageContext(screenRect.size); [value drawInRect:screenRect blendMode:...

Allowing interaction with a UIView under another UIView

Is there a simple way of allowing interaction with a button in a UIView that lies under another UIView - where there are no actual objects from the top UIView on top of the button? For instance, ...

热门标签