我在Storyboard中的两个ViewController之间有一个show segue。当呼叫performSegueWithIdentifier:
,我得到一个NSInvalidArgumentException
:Storyboard认为Segue不存在。但它确实
Receiver (<[MY VIEWCONTROLLER SUBCLASS]: 0x7fc9e99f0640>) has no segue with identifier 'HomeToSettings''
的赛格瑞肯定存在并连接,并有在同一起源的ViewController是做工精细许多其他塞格斯。
在故事板的源代码,SEGUE显示出来,就像所有的工作的:
<connections>
<outlet property="notificationsButton" destination="hG9-8E-sv6" id="mn0-1x-Qxj"/>
<outlet property="settingsButton" destination="Fy0-au-d6J" id="r1c-fG-KOP"/>
<outlet property="tableView" destination="9bJ-Cd-hc3" id="Wuy-hJ-QVU"/>
<segue destination="ad8-yH-D5h" kind="show" identifier="HomeToCreateList" id="bsg-J2-Gp3"/>
//More segues...
<segue destination="pNX-Jw-wau" kind="show" identifier="HomeToNotifications" id="B2t-BE-YpW"/>
<segue destination="xge-ah-WXM" kind="show" identifier="HomeToSettings" id="nTa-qO-SCb"/>
</connections>
我曾尝试:
- 重命名故事板
- 删除并重新创建segue
- 重命名segue
- 清理项目
- 重新安装应用程序
- 重置内容和设置在模拟器上
- 物理设备
Xcode和iOS的是最新的6月1日,2016年
如果它在某种程度上很重要,我通过附加到UIBarButtonItem的IBAction触发segue。但是,从另一个UIBarButtonItem到另一个ViewController的另一个segue完美工作。
与我打电话SEGUE确切行是:
[self performSegueWithIdentifier:@"HomeToSettings" sender:self];
我真的失去了这里。
你检查,如果SEGUE可在要测试的尺寸级别? – dasdom
我该怎么做? –
进入界面构建器。在底部有一些说“任何:任何”的东西。更改为您正在测试的大小类,并查看该segue是否仍然存在。顺便说一句:Interface Builder不好,原因有几个。你应该在代码中创建UI。 – dasdom