我在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