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 toB.storyboard
, and it has a manual segue from one of the viewControllers inA
B.storyboard
has a reference toZ.storyboard
- it gets there via a manual segue from one of the viewControllers inB
Running XCode Version 7.0 (7A218) which is the GM seed build
Found the problem (I'm using Xcode 7.1.1).
After using Product --> Refactor to storyboard, it create a storyboard references with a storyboard ID same than the reference ID (attributes & identity inspector).
This is a bug, storyboard ID should be nil and only the reference ID should be filled.
Update #1 : When creating multiple storyboard reference using "Refactor to storyboard", it create the same object ID which cause this error too.
Update #2 : Just don't use the "Refactor to storyboard" feature if you target iOS 8. It create multiple doublons with objectId which cause an error like :
As far as I can tell, there's no need to reference a reference, and this seems to be the thing it's complaining about. When you use 'refactor to storyboard', it leaves the storyboard id in the reference.
First you need to find which Reference is doubled UIViewController-5kv-Ul-Bah - it was my error
Press cmd + 3 and input id (5kv-Ul-Bah) without "UIViewController-" find doubled references
You should see something like this
In my case it is InvitationDetails.storyboard and Location.storyboard
You have 2 options:
Option 1: Remove Storyboard Reference from storyboard and add another one (do this with my other instructions https://stackoverflow.com/a/33753164/2493555)
Option 2: Open new created storyboard as source code
then find our id and change it to another like "5kv-Ul-Bahxx" (I add xx postfix) but you need to be sure that string "5kv-Ul-Bahxx" is not exist in project (by pressing cmd + 3 and find)
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 inB.storyboard
and also inZ.storyboard
which both had the Storyboard ID ofZNavigationController
. The one inB.storyboard
had an incorrect ID which I removed.Looks like Xcode is misattributing the (correct) error to
A.storyboard
instead ofB