Reputation: 41
Example project: http://d.pr/f/v7zD
I'm trying to build an app that would show two GLKViewController
s. 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 GLKView
s.
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.
Upvotes: 3
Views: 1114
Reputation: 40030
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.
Upvotes: 2