1

我正在使用everyplay来记录我的游戏过程,玩家可以在结果屏幕上分享视频。

在 iPad 上记录、分享和查看个人资料运行良好,但是当我在 Everyplay 页面点击“分享”、“查看每个播放个人资料”按钮时,每个 iPhone 版本(4、4S、5)都会崩溃。

当我们点击这两个按钮时,我们跟踪了正在发生的事情。

2013-08-01 10:29:19.489 ZombieBlackout[6602:907] Video Updated
2013-08-01 10:29:20.786 ZombieBlackout[6602:907] everyplayRecordingStopped
2013-08-01 10:29:20.788 ZombieBlackout[6602:907] everyplayShown
2013-08-01 10:29:22.393 ZombieBlackout[6602:907] Audio route change while recording was stopped.
2013-08-01 10:29:22.394 ZombieBlackout[6602:907] A route change occurred that does not require stopping application audio.
2013-08-01 10:29:22.451 ZombieBlackout[6602:907] Audio route change while recording was stopped.
2013-08-01 10:29:22.453 ZombieBlackout[6602:907] A route change occurred that does not require stopping application audio.
2013-08-01 10:29:27.488 ZombieBlackout[6602:907] Video Updated
2013-08-01 10:29:35.383 ZombieBlackout[6602:907] *** Terminating app due to uncaught exception 'UIApplicationInvalidInterfaceOrientation', reason: 'Supported orientations has no common orientation with the application, and shouldAutorotate is returning YES'
*** First throw call stack:
(0x3304f3e7 0x3ad40963 0x3304f307 0x34ec688f 0x3506b0c9 0x3f388d 0x3f0dad 0x3e1e5b 0x3e1d4b 0x3b15a793 0x3b15a5db 0x3b15de45 0x330231b1 0x32f9623d 0x32f960c9 0x36b7433b 0x34eb22b9 0xb1503 0xb02b8)
libc++abi.dylib: terminate called throwing an exception

而且我不认为这是因为我们的构建是在 iPhone 上,因为我在 iPhone 上尝试了 Nimble Quest,我能够点击所述的 2 个按钮。

我正在使用 Cocos2dx,我们的编码方式已经为 Android 做好了准备。我想知道 Everyplay 的 cocos2dx 是否有问题。

请指教。谢谢

4

1 回答 1

3

我假设你的游戏只是风景。在这种情况下,您有两种选择如何解决此问题。

选项1:

将 UISupportedInterfaceOrientations 数组添加到游戏的 info.plist 中,其中包含 UIInterfaceOrientationPortrait、UIInterfaceOrientationLandscapeLeft、UIInterfaceOrientationLandscapeRight 和 UIInterfaceOrientationPortraitUpsideDown 项。通过从项目摘要页面检查所有支持的接口方向或手动编辑 info.plist 文件,您可以轻松地从 xCode 执行此操作。

选项 2:

将以下方法添加到应用程序的 AppDelegate.m 文件中:

// IOS 6

-(NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window {
  return UIInterfaceOrientationMaskAll;
}

在这两种情况下,您还必须确保已将仅横向方向处理代码添加到游戏的 UIViewController。

// IOS 5

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation {
  return UIInterfaceOrientationIsLandscape(toInterfaceOrientation);
}

// IOS 6

- (BOOL)shouldAutorotate {
   return YES;
}

- (NSUInteger)supportedInterfaceOrientations {
  return UIInterfaceOrientationMaskLandscapeLeft | UIInterfaceOrientationMaskLandscapeRight;
}
于 2013-08-13T06:00:30.547 回答