Why does my application crash every time I try to show two child view controllers that are GLKViewControllers?
Example project: http://d.pr/f/v7zD
I'm trying to build an app that would show two GLKViewControllers. I'm using Storyboards, so I have my main view controller (the initial one) with two container views in it that branch off into two UIViewControllers that have a custom class of OpenGLViewController (which is just a subclass of GLKViewController I've created).
The views within those two child view controllers are GLKViews.
Yet, every time I run it I get this error as soon as it launches:
* Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '-[GLKViewController loadView] loaded the "BYZ-38-t0r-view-8bC-Xf-vdC" nib but didn't get a GLKView.'
How do I make this work? I'm pulling my hair out.
Is your view IB outlet correctly set?
It can be that your GLKViewController subclass, is not able to find the expected outlet to a GLKView.
I managed to fix your project. You can download it here. Basically, the view outlets were incorrectly set and the initial view controller class was wrongly set in IB. I also set the delegates. Check out the screenshots.
Hope it helps.