对的开始/结束外观转换的调用不平衡
我放弃了这一点,我只是不知道出了什么问题以及出在哪里...... 问题是:在我使用 Cocos2d 的 iPhone 应用程序中,我通过 viewController 配置了自动旋转;但是,因为当用户在身份验证期间点击“创建新帐户”时游戏中心打开其视图时,该视图不会收到任何触摸,但触摸会转到游戏视图(隐藏在游戏中心视图下) 。
我已经尝试了我想到的一切,但是由于我没有找到有关此游戏中心视图的任何回调,因此很难找到纠正此问题的方法...
这是游戏视图的初始化:
// Init the UI View Controller
//
viewController = [[SQViewController alloc] initWithNibName:nil bundle:nil];
viewController.wantsFullScreenLayout = YES;
EAGLView *view = [EAGLView viewWithFrame:[window bounds] pixelFormat:kEAGLColorFormatRGBA8 depthFormat:GL_DEPTH_COMPONENT24_OES];
[director setOpenGLView:view];
[director setDeviceOrientation:kCCDeviceOrientationPortrait];
[view removeFromSuperview];
[viewController setView:view];
[window addSubview:viewController.view];
[window makeKeyAndVisible];
我尝试了很多其他事情,评论了这段代码中的每一行,尝试了其他一些(例如 setHidden:NO、bringSubviewToFront...),但我能得到的唯一结果是: - 游戏显示正常,游戏中心正常,但无法自动旋转 - 游戏以纵向显示(视图控制器仅允许横向模式),游戏中心正常,不自动旋转 - 游戏未显示(黑屏),游戏中心正常
并且无法使其全部一起工作...我唯一的线索是这个主题的标题,“开始/结束外观转换的不平衡调用。”但由于我自己不调用游戏中心视图,我不知道该怎么办...
有人知道吗?
I give up on that point, I just can't figure out what is wrong and where...
Here is the problem: in my iPhone application using Cocos2d, I configured autorotation through a viewController; however, since, when Game center opens its view as the user taps on "Create new account" during the authentication, this view does not receive any touch, but the touch go to the game's view (which is hidden under the Game center view).
I have tried everything I thought about, but since I did not find any callback about this Game Center View, it is hard to find a way to correct this...
Here is the initialization of the game's view:
// Init the UI View Controller
//
viewController = [[SQViewController alloc] initWithNibName:nil bundle:nil];
viewController.wantsFullScreenLayout = YES;
EAGLView *view = [EAGLView viewWithFrame:[window bounds] pixelFormat:kEAGLColorFormatRGBA8 depthFormat:GL_DEPTH_COMPONENT24_OES];
[director setOpenGLView:view];
[director setDeviceOrientation:kCCDeviceOrientationPortrait];
[view removeFromSuperview];
[viewController setView:view];
[window addSubview:viewController.view];
[window makeKeyAndVisible];
I have tried many other things, commented every single line in this code, tried some others (such as setHidden:NO, bringSubviewToFront...), but the only results I could get were:
- Game display ok, Game Center ok, but no autorotate
- Game displayed in portrait (the view controller only allow landscape modes), Game Center ok, no autorotate
- Game not displayed (black screen), Game Center ok
And no way to make it all work together... The only clue I have is the title of this topic, "Unbalanced calls to begin/end appearance transitions for ." But since I do not call the Game Center view myself, I don't know what to do with this...
Anyone, any idea?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
自从升级到 iOS 5.0 以来,我在 cocos2d 构建的应用程序中显示游戏中心排行榜时遇到了同样的问题。我在其他地方看到过对此的引用,这是由子视图控制器失去对父视图控制器的焦点引起的,但我也无法验证这一点或在我的应用程序中解决此问题。
好消息是我已经通过仪器运行了这个 - 没有内存泄漏。还重复执行相同的操作,没有明显的失败或不良影响。
因此,虽然此消息令人烦恼,但它似乎(至少目前)不会对应用程序产生不利影响。
I've had the same problem while displaying game center leaderboards in my cocos2d built App ever since moving up to iOS 5.0. I've seen references elsewhere to this being caused by a sub viewcontroller losing focus on the parent viewcontroller, but I've been unable to verify that or get this resolved in my app either.
Good news is that I've run this thru instruments - No Memory Leaks. Also executed the same action repetitively with no apparent failures or ill effects.
So while this message is an annoyance, it doesn't appear (at least for now) to adversely affect the App.
当您尝试在前一个 ViewController 完成之前推送一个 viewController 时,会发生此错误。意味着您正在尝试同时推送 2 个 ViewController。
This Error occurs when you try to push a viewController before previous ViewController is finished . Means you are trying to push 2 ViewControllers at the same time.