Cocos2D with UIKit

We were required to integrate cocos2d into UIKit project. We found the ARC based template for such purpose on github and it was based on one of raywenderlich tutorials. That tutorial post will get you familiar with the setup and details.

We ran into a problem, basically a crash during one situation. It happened when we were trying to pop up the viewcontroller on which our cocos2d view was added, and later pushing same viewcontroller into the navigation. Error was:

OpenGL error 0x0501 in -[CCShaderCache loadDefaultShaders] 100

Lots of insights were available from stackoverflow on that error. We found a solution that worked for me.

-(void)closeGameVC
{
      [[CCDirector sharedDirector] setView:nil];
      [glView  removeFromSuperview];
      [[CCDirector   sharedDirector]  end];
	[self.navigationController  popViewControllerAnimated:YES];
}

One Comment

  • Oyee pandu………good one.
    HeHeHe…:D

Join the Discussion

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>