请把代码粘贴在这里 ``` 我最近做的一个项目是把 iOS中的代码集成到cocos2dx游戏中。 我在AppController.mm文件didFinishLaunchingWithOptions方法中添加了一个UIView:(代码如下) ... viewController = initWithNibName:nil bundle:nil]; viewController.wantsFullScreenLayout = YES; viewController.view = __glView; //LSFView 继承自UIView,上面有几个按钮 LSFView *myView = initWithFrame:frame]; viewController.view addSubView:myView]; // Set RootViewController to window if ( .systemVersion floatValue] < 6.0) { // warning: addSubView doesn't work on iOS6 ; } else { // use this method on ios6 ; } ``` … 运行游戏之后,点击myView会调转到另外一个UIViewController中。现在的问题是从UIViewController页面中返回到游戏界面,游戏就会卡住不同,然后Xcode的控制台会不停的打印日志 OpenGL error 0x0502 in - 325 Cocos2d: OpenGL error 0x0506 in /Users/apple/LSF/cocos2d-x/cocos2d-x-2-1.2/cocos2dx/sprite_nodes/CCSprite.cpp draw 584 Cocos2d: OpenGL error 0x0506 in /Users/apple/LSF/cocos2d-x/cocos2d-x-2-1.2/cocos2dx/textures/CCTextureAtlas.cpp drawNumberOfQuads 686 Cocos2d: OpenGL error 0x0506 in /Users/apple/LSF/cocos2d-x/cocos2d-x-2-1.2/cocos2dx/sprite_nodes/CCSprite.cpp draw 584 Cocos2d: OpenGL error 0x0506 in /Users/apple/LSF/cocos2d-x/cocos2d-x-2-1.2/cocos2dx/sprite_nodes/CCSprite.cpp draw 584 Cocos2d: OpenGL error 0x0506 in /Users/apple/LSF/cocos2d-x/cocos2d-x-2-1.2/cocos2dx/sprite_nodes/CCSprite.cpp draw 584 Cocos2d: OpenGL error 0x0506 in /Users/apple/LSF/cocos2d-x/cocos2d-x-2-1.2/cocos2dx/sprite_nodes/CCSprite.cpp draw 584 Cocos2d: OpenGL error 0x0506 in /Users/apple/LSF/cocos2d-x/cocos2d-x-2-1.2/cocos2dx/textures/CCTextureAtlas.cpp drawNumberOfQuads 686 Cocos2d: OpenGL error 0x0506 in /Users/apple/LSF/cocos2d-x/cocos2d-x-2-1.2/cocos2dx/sprite_nodes/CCSprite.cpp draw 584 Cocos2d: OpenGL error 0x0506 in /Users/apple/LSF/cocos2d-x/cocos2d-x-2-1.2/cocos2dx/sprite_nodes/CCSprite.cpp draw 584 Cocos2d: OpenGL error 0x0506 in /Users/apple/LSF/cocos2d-x/cocos2d-x-2-1.2/cocos2dx/sprite_nodes/CCSprite.cpp draw 584 Cocos2d: OpenGL error 0x0506 in /Users/apple/LSF/cocos2d-x/cocos2d-x-2-1.2/cocos2dx/sprite_nodes/CCSprite.cpp draw 584 Cocos2d: OpenGL error 0x0506 in /Users/apple/LSF/cocos2d-x/cocos2d-x-2-1.2/cocos2dx/sprite_nodes/CCSprite.cpp draw 584 Cocos2d: OpenGL error 0x0506 in /Users/apple/LSF/cocos2d-x/cocos2d-x-2-1.2/cocos2dx/sprite_nodes/CCSprite.cpp draw 584 Cocos2d: OpenGL error 0x0506 in /Users/apple/LSF/cocos2d-x/cocos2d-x-2-1.2/cocos2dx/sprite_nodes/CCSprite.cpp draw 584 这些日志会不停的重复打印,直到我点击一下myView就可以恢复正常。 这个问题已经严重影响到我的项目的进度,目前不知道是什么原因,希望大家能够帮忙解决这个问题,不胜感激。
谢谢你了,根据题提供的方法,现在成功解决了该问题了,非常感谢
解决了吗?我也有相同问题求帮助!