Hi,
I am trying to make use of the Storyboard References introduced in iOS 9, and have the following issue:
- SB References seem to only work with "internal" (ie: part of my TestApp project) storyboards
- If I put the same test Storyboard in a Resources.bundle, I can't access it and I get a runtime crash
I have the following setup:
- TestSB.storyboard, containing a TestVC View controller, which has the following StoryboardID: ID_Test
- TestSB.storyboard is part of the TestResources.bundle, which has the following bundle ID: net.MyCompany.TestResources
- TestResources.bundle is properly included in my TestApp (I can instantiate TestVC programmatically, in my TestApp, by calling [Storyboard instantiateViewControllerWithID], for instance)
- I put a Storyboard Reference to it in my Main.storyboard, with the following settings:
Storyboard: TestSB
Reference ID: ID_Test
Bundle: net.MyCompany.TestResources
My observations:
- When trying to access the storyboard reference to TestSB, I get the following runtime crash:
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Could not find a storyboard named 'TestSB' in bundle NSBundle </var/containers/Bundle/Application/9A712A2C-31D4-4AA4-B1CB-7E86EB9C7DF4/MyTestApp.app> (loaded)'
=> what's troubling me is that this is NOT the bundle that I indicated (net.MyCompany.TestResources), but the TestApp's bundle. In fact, I always get the same error message, independently from what I enter in the "Bundle" setting of the Storyboard Reference in Main.storyboard.
- The other way around: if TestSB.storyboard is directly included in my TestApp project, it works. But again, this works all the time, independently from what I enter in the "Bundle" setting of the Storyboard Reference in Main.storyboard, which doesn't make much sense (I expect this to work when the bundle setting is left empty (= default bundle), not when I enter a non-existing bundle)
I am using XCode 8 Beta 6 and iOS 10 beta 8 on my test iPad.
1) Could it be a bug in XCode 8 beta?
2) Or am I doing something wrong?
Any help is appreciated, thanks!