Unwind Segue将UITabBarController跳过以前的UIViewController

时间:2015-04-29 09:31:55

标签: ios objective-c uiviewcontroller uistoryboardsegue

我遇到了一个问题,即Unwind Segue正在跳过UITabBarController并转而使用之前的UIViewController。我目前的设置是

UINavController> UIViewController1> UIViewController2> UITabBarController(UIViewController3)> UIViewController4

当我使用UIViewController4中的Unwind segue时,我返回到UIViewController2,而不是我的UITabBarController(UIViewController3)。

作为测试,我输入了以下代码

-(IBAction)doneUnWindSegue:(UIStoryboardSegue *)segue sender:(id)sender{
    NSLog(@"Anything? 1");
}
在UIViewControllers 1和2中以及在我的UITabBarController内的UIViewController3中的

。 (对于每个视图控制器,“Anything?”之后的数字会被更改,因此我知道调用了哪一个。)

当从UIViewController2中删除代码时,Unwind Segue转到UIViewController1,当从1和2中删除时,没有任何反应。我看不出任何方法让它放松到UIViewController3。

enter image description here

当单击动作旁边的右箭头时,我将被带到UITabBarController内的UIViewController3中的正确位置。 (假设已经从UIViewController 1和2中删除了上面的代码。当它不是时,单击该箭头,同时将我带到UIViewController2,然后UIViewController1,如果它已从UIViewController2中删除)

我在UIViewController4中点击UITableViewCell时调用了Unwind,但是我从同一个ViewController中的UIButton获得了相同的结果。在创建Unwind Segue时,我从Prototype单元格拖动到Exit图标并选择“Selection Segue”并执行相关操作。

希望我已经完全解释了这一点,因为它有点复杂,也是一个非常奇怪的问题。

感谢您提供任何帮助。

0 个答案:

没有答案
相关问题