title: Cocos2d fails on iPad yet works in simulator
body: <p>I have a very simple game using Xcode v4.2.1, Cocos2d v5.0.1.  I've tried both compilers in Xcode (LLVM GCC 4.2 and Apple LLVM compiler 3.0.  Is there a preference??)  On the game screen is a UIKit button that presents the user with a Interface Builder (nib) Settings/Options screen to customize the game a bit.  This is all based on what I learned in Ray Wenderlich's tutorial (http://www.raywenderlich.com/4817/how-to-integrate-cocos2d-and-uikit).</p>
  
  <p>After the user makes their changes, they are returned to the game and the changes are in place.</p>
  
  <p>This all works as I want in the simulator, however, when I test the game on an iPad I get the following errors in the debug window:</p>
  
  <pre><code>2012-01-27 18:25:27.305 BonkBonk[1082:707] failed to call context
  2012-01-27 18:25:27.310 BonkBonk[1082:707] cocos2d: surface size: 1024x768
  2012-01-27 18:25:27.316 BonkBonk[1082:707] Failed to make complete framebuffer object 8cdd
  OpenGL error 0x0506 in -[EAGLView swapBuffers]
  OpenGL error 0x0506 in -[EAGLView swapBuffers]
  OpenGL error 0x0506 in -[EAGLView swapBuffers]
  </code></pre>
  
  <p>The OpeenGl errors continue on indefinitely.</p>
  
  <p>I use the function viewWillAppear to capture the return from the settings/options screen so that I can pass the new settings to the game layer.  If I comment out this code the problem goes away, however, I am not able to get the new user settings to the game layer.</p>
  
  <p>Here is the code:</p>
  
  <pre><code>- (void) viewWillAppear:(BOOL)animated
  {
      [self.navigationController setNavigationBarHidden:YES animated:animated];
      //CCScene *scene = [[CCDirector sharedDirector] runningScene];
      CCScene *scene = [BonkBonkLayer scene];
      id layer = [scene getChildByTag:1];
      [layer userSettings];
      [super viewWillAppear:animated];
  }
  </code></pre>
  
  <p>The commented out line //CCSene *scene... was another failed attempt at getting the layer object from the scene so that I could call the userSettings method where the game layer then can assimilate it into the game.</p>