I have an iOS app targeting iOS 8 and 9 which I'm in the process of upgrading to use Storyboard References instead of links through code. I've gradually converted more and more bits over, when suddenly I started getting this compiler error:
: error: Deploying Storyboard References to iOS 8.0 requires that your storyboards do not share any view controller identifiers. A.storyboard and Z.storyboard both contain a view controller with identifier "ZNavigationController".
Z.storyboard
absolutely contains ZNavigationController
, it's supposed to be there, however A.storyboard
assuredly does not contain any such navigation controller. I've opened the .storyboard file in a text editor and verified that there is no mention of ZNavigationController
.
To give some more context:
A.storyboard
has a reference to B.storyboard
, and it has a manual segue from one of the viewControllers in A
B.storyboard
has a reference to Z.storyboard
- it gets there via a manual segue from one of the viewControllers in B
Running XCode Version 7.0 (7A218) which is the GM seed build
答案 0 :(得分:9)
发现问题(我正在使用Xcode 7.1.1)。
使用产品后 - >重构到故事板,它创建一个故事板引用,其故事板ID与参考ID(属性和身份检查员)相同。
这是一个错误,故事板ID应为零,只应填写参考ID。
更新#1: 使用“Refactor to storyboard”创建多个Storyboard引用时,它会创建导致此错误的相同对象ID。
更新#2: 如果你的目标是iOS 8,就不要使用“Refactor to storyboard”功能。它会使用objectId创建多个双重导致错误,如:
/* com.apple.ibtool.errors */ : error: Deploying Storyboard References to iOS 8.0 requires that your storyboards do not share any view controller identifiers. Category.storyboard and Home.storyboard both contain a view controller with identifier "UIViewController-BX3-FJ-k0T".
答案 1 :(得分:4)
I did a bit more digging and it turns out that even though A.storyboard
didn't have anything with that storyboard ID, there was a controller in B.storyboard
and also in Z.storyboard
which both had the Storyboard ID of ZNavigationController
.
The one in B.storyboard
had an incorrect ID which I removed.
Looks like Xcode is misattributing the (correct) error to A.storyboard
instead of B
答案 2 :(得分:3)
首先,您需要找到哪个参考被加倍 UIViewController-5kv-Ul-Bah - 这是我的错误
按cmd + 3并输入id( 5kv-Ul-Bah )而不使用“ UIViewController - ”查找加倍参考
你应该看到类似的东西
在我的情况下,它是InvitationDetails.storyboard和Location.storyboard
您有两个选择:
选项1 :从情节提要中删除故事板参考并添加另一个(使用我的其他说明执行此操作https://stackoverflow.com/a/33753164/2493555)
选项2 :打开新创建的故事板作为源代码
然后找到我们的ID并将其更改为另一个像“5kv-Ul-Bahxx”(我添加xx后缀)但你需要确保字符串“5kv-Ul-Bahxx”不是项目中存在(通过按cmd + 3并查找)
答案 3 :(得分:0)
据我所知,没有必要引用引用,这似乎是它所抱怨的事情。当您使用“重构”到故事板时,它会将故事板ID保留在引用中。