Receiver没有带标识符的segue [英] Receiver has no segue with identifier

查看:117
本文介绍了Receiver没有带标识符的segue的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个问题,我一整天都在坐着。在这个超级视图中,我有一个包含UIPageControl和UIScrollView的超级视图。我创建了一个子视图,其中包含三个图像,三个标签和三个按钮。每个按钮都有一个补足事件。触发按钮事件时,新视图将提升超级视图。为此,我创建了一个与超级视图和新视图相关联的segue。以下是超级视图中的连接代码。

I have a problem that I've been sitting with all the day. I have a super view which contains UIPageControl and UIScrollView, in this super view. I have created a sub view which contains three images, three labels, and three buttons. Each button has a touch up event. When the button event is triggered the super view will be promoted by a new view. For doing that, I created a segue which connected with super view and new view. Here is the connection code in the super view.

`                    
<connections>
    <outlet property="pageControl" destination="ivy-0Q-UQo" id="rGm-sh-mdE"/>
    <outlet property="scrollView" destination="4Yu-Qb-kbF" id="aqY-ou-cv4"/>
    <segue destination="zZo-CH-P2Y" kind="push" id="xBU-ZO-u7s"/>
</connections>

`

这段代码将会保证超级视图和新视图之间的连接没问题,
这里是补足事件代码。

This piece of code will guarantee the connection between the super view and the new view is okay, here is the touch up event code.

WelcomeFrameViewController *welcomeFrameVC = [WelcomeFrameViewController alloc];  //super view instance
NSLog(@"=======================");
[welcomeFrameVC performSegueWithIdentifier: @"ForwardToLogin" sender: self];

当我运行程序时,编译器抱怨

When I run the program, the compiler complains with

2012-08-20 10:17:02.325 TTRen[2440:f803] ============44===========

2012-08-20 10:17:02.352 TTRen [2440:f803] * 由于未捕获的异常'NSInvalidArgumentException'而终止应用程序,原因:'Receiver WelcomeFrameViewController:0x688e960没有标识符'ForwardToLogin'的segue''

2012-08-20 10:17:02.352 TTRen[2440:f803] * Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Receiver WelcomeFrameViewController: 0x688e960 has no segue with identifier 'ForwardToLogin''

我很iOS中的新功能,任何建议都将深受赞赏。

I am quite new in iOS, any suggestions will be deeply appreciated.

推荐答案

似乎有一个xCode的错误(仍然在6)您所做的故事板更改不会被复制到模拟器。您可以重置模拟器的内容和放大器设置以解决此问题。

There does seem to be a bug with xCode (still in 6) where storyboard changes you make aren't get copied to the simulator. You can reset the Simulator's Content & Settings to resolve this.

其他要检查的事项:


  • 检查你的segue的命名。再次检查。再检查一下: - )

  • 确保你的segue指向正确的方向。它需要指向远离调用 performSegue ... UIViewController

  • 确保你没有视图控制器的两个副本在彼此的顶部,segue连接到顶部的那个,你实例化下面的那个!

  • Check the naming of your segue. Check it again. Check it some more :-)
  • Ensure that your segue is pointing in the right direction. It needs to point away from the UIViewController that calls performSegue….
  • Ensure you don't have two copies of your view controller on top of each other, with the segue attached to the one on top, and you instantiating the one underneath!

这里有一个类似的问题,我也遇到了同样的问题。重置为我修好了。

There's a similar question here and I encountered the same problem too. The reset fixed it for me.

这篇关于Receiver没有带标识符的segue的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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