title: How to Setup GLKViewController Library Object with GLKView in Interface Builder NIB
body: <p>{Xcode 4.4, deployment target iOS5.0, not storyboard, using ARC}</p>
  
  <p>I have been looking into OpenGL in iOS &amp; I've had no problem creating the GLKViewController &amp; GLKView programically as many tutorials show. I wanted to try using the GLKViewController library object in interface builder, but I haven't yet found any tutorial or info except for a storyboard setup, which I'm not using. My own attempt isn't working 100%, so I'm showing screenshots of my setup here in the hope somebody can tell me what I'm doing wrong. Just to clarify, it is using this object in interface builder I'm referring to:</p>
  
  <p><img src="https://i.stack.imgur.com/OBDHp.jpg" alt="GLKViewController Library Object"></p>
  
  <p>I set it up by dragging a GLKViewController object from the library into IB, which puts a child GLKView there too. I removed the default view, &amp; so it looks like this:</p>
  
  <p><img src="https://i.stack.imgur.com/kXeuJ.jpg" alt="IB Layout"></p>
  
  <p>I created a GLKView outlet property in my OpenGLVC2 class (a GLKViewController) &amp; I wired the outlets like this:</p>
  
  <p><img src="https://i.stack.imgur.com/hlpz7.jpg" alt="IB Outlets"></p>
  
  <p>Actually, at first I didn't have the view outlet in file's owner wired because that's already done automatically in the GLKViewController object, but that terminates with an error "loaded the OpenGL2_iPhone nib but the view outlet was not set". I also had the file's owner delegate wired to the GLKViewController object, but that terminates with an error "this class is not key value coding-compliant for the key delegate". I thought that because the GLKViewController in IB I set to be of custom class OpenGLVC2, that the GLKViewController <em>is</em> the file's owner once they're stitched together at runtime, but obviously I'm wrong about that.</p>
  
  <p>So having it wired as the screenshot above shows, the setup actually works as far as drawing to the screen once, but I don't get the rendering loop (ie update method doesn't fire), &amp; other methods like shouldAutorotateToInterfaceOrientation: don't fire. It seems my GLKView delegation to my OpenGL2VC class is working fine but my GLKViewController isn't.</p>
  
  <p>Is it possible with the IB nib approach to have the GLKViewController &amp; GLKView methods in the same GLKViewController class? That's how it was done programically in the tutorials I did (in fact, at first step all the code was in the AppDelegate). Here's a screenshot of my identity &amp; attribute inspectors for the GLKViewController &amp; GLKView, in case something there is wrong:</p>
  
  <p><img src="https://i.stack.imgur.com/I2UB2.jpg" alt="Identity and Attribute Inspectors"></p>
  
  <p>Thanks in advance.</p>