拖动到viewcontroller的出口不起作用 [英] Dragging onto the exit of the viewcontroller not working

查看:114
本文介绍了拖动到viewcontroller的出口不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我到处都在寻找这个问题。
我知道展开场景是如何工作的。我在A VC中实现了以下代码

I have looked for this problem everywhere. I know how the unwind scene works. I have implemented the following code in the A VC

-(IBAction)returned:(UIStoryboardSegue *)segue {
try.text = @"Returned from Scene 1";
}

但是当我去我的B VC(这是我想要的VC)回到A VC来)并按住一个按钮到底部的出口,它将不允许我。并且退出选项中不会弹出任何功能。其他人有这个问题或者可以提供帮助吗?

But when I go to my B VC(Which is the VC I want to go back to A VC from) and ctrl drag a button onto the exit at the bottom it will not allow me to. And no function pops up in the exits option. Anyone else had this issue or can help?

推荐答案

要设置展开segue,你应该

To set up an unwind segue, you should


  1. 使用标准模态设置两个场景或在它们之间推送segue:

  1. Set up your two scenes with the standard modal or push segue between them:

定义自定义类将这两个场景作为各自的视图控制器。

Define the custom classes for those two scenes to be your respective view controllers.

在视图控制器A的.m中实现操作:

Implement the action in the .m for view controller A:

- (IBAction)unwindToA:(UIStoryboardSegue *)segue
{
    //returning to A
}


  • 然后你可以通过 control -dragging(或右边 - )在B中创建一个segue点击拖动)从某个控件向下到场景下方栏中的出口 B

  • Then you can create a segue in B by control-dragging (or right-click-dragging) from some control down to the exit outlet in the bar below scene B:

    如果以上所有内容均为CONFI如果正确的话,你现在可以在popover中看到你的unwind segue:

    And if everything above is configured correctly, you will now see your unwind segue listed in a popover:

    这篇关于拖动到viewcontroller的出口不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

  • 查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆