1

我们在游戏中使用 Everyplay 进行录制,它似乎工作正常,但例如,当调用以下行时,我们的应用程序崩溃:

[[EveryplaysharedInstance] showEveryplay]

在 iOS 9.1、iPhone 5S 上进行测试。无论我们在 UI 中自己调用它还是在 Everyplay 的预览窗口中按下 Everyplay 按钮(调用时显示[[EveryplaysharedInstance] playLastRecording]),都会发生崩溃。简单地关闭 Everyplay 的预览窗口时会发生另一个崩溃。

  • 添加所有框架。

  • 初始化是在viewDidLoad我们的视图控制器的方法中完成的:

    [EveryplayinitWithDelegate:self 和ParentViewController:self]

  • EveryplayDelegate 方法按预期调用。就在everyplayShown调用崩溃委托方法之前。

您是否遇到过类似的问题?知道在哪里搜索吗?

任何帮助表示赞赏!

编辑:添加了堆栈跟踪和崩溃日志!

堆栈跟踪(控制台中的 bt 输出):

* thread #1: tid = 0x1faed, 0x00000001993bf140 libsystem_kernel.dylib`__pthread_kill + 8, queue = 'com.apple.main-thread', stop reason = signal SIGABRT
frame #0: 0x00000001993bf140 libsystem_kernel.dylib`__pthread_kill + 8
frame #1: 0x0000000199488ef8 libsystem_pthread.dylib`pthread_kill + 112
frame #2: 0x0000000199332b78 libsystem_c.dylib`abort + 140
frame #3: 0x00000001012f9490 Project`uncaught_exception_handler + 36
frame #4: 0x0000000183f912d0 CoreFoundation`__handleUncaughtException + 652
frame #5: 0x0000000198a5423c libobjc.A.dylib`_objc_terminate() + 112
frame #6: 0x00000001980f6f44 libc++abi.dylib`std::__terminate(void (*)()) + 16
frame #7: 0x00000001980f685c libc++abi.dylib`__cxa_throw + 136
frame #8: 0x0000000198a54094 libobjc.A.dylib`objc_exception_throw + 332
frame #9: 0x0000000188d6b8bc QuartzCore`CA::Display::DisplayLinkItem::dispatch() + 164
frame #10: 0x0000000188d6b6f4 QuartzCore`CA::Display::DisplayLink::dispatch_items(unsigned long long, unsigned long long, unsigned long long) + 424
frame #11: 0x000000018522a2f8 IOKit`IODispatchCalloutFromCFMessage + 372
frame #12: 0x0000000183f32840 CoreFoundation`__CFMachPortPerform + 180
frame #13: 0x0000000183f48c7c CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 56
frame #14: 0x0000000183f483b4 CoreFoundation`__CFRunLoopDoSource1 + 436
frame #15: 0x0000000183f4610c CoreFoundation`__CFRunLoopRun + 1800
frame #16: 0x0000000183e74ca0 CoreFoundation`CFRunLoopRunSpecific + 384
frame #17: 0x000000018f0b0088 GraphicsServices`GSEventRunModal + 180
frame #18: 0x000000018958cffc UIKit`UIApplicationMain + 204
frame #19: 0x000000010102d568 Project`main(argc=1, argv=0x000000016fdfba80) + 152 at main.m:39
frame #20: 0x00000001992a28b8 libdyld.dylib`start + 4

XCode 的崩溃日志:

    Last Exception Backtrace:
0   CoreFoundation                  0x183c58f48 __exceptionPreprocess + 124
1   libobjc.A.dylib                 0x19871bf80 objc_exception_throw + 56
2   CoreFoundation                  0x183c58e90 +[NSException raise:format:] + 120
3   UIKit                           0x18926456c -[UIViewController __supportedInterfaceOrientations] + 912
4   UIKit                           0x189263efc -[UIViewController _preferredInterfaceOrientationGivenStatusBarAndDeviceAndOrientation:] + 96
5   UIKit                           0x18956e9e8 -[UIViewController _legacyInterfaceOrientation] + 652
6   Project                         0x10146cc30 -[EveryplayNavigationViewController loadView] + 88
7   UIKit                           0x1891ebd44 -[UIViewController loadViewIfRequired] + 144
8   UIKit                           0x1891ebc9c -[UIViewController view] + 28
9   Project                         0x10146c850 -[EveryplayNavigationViewController initWithOverlayNavigationBar:] + 164
10  Project                         0x101489f50 -[EveryplaySocialViewController initWithOverlayNavigationBar:] + 56
11  Project                         0x101424330 __34-[Everyplay showEveryplayWithURL:]_block_invoke + 432
12  Project                         0x10144ec54 +[EveryplayCommon runInMainThread:] + 64
13  Project                         0x101424154 -[Everyplay showEveryplayWithURL:] + 136
14  Project                         0x101424090 -[Everyplay showEveryplayWithPathInternal:] + 384
15  Project                         0x101423074 -[Everyplay showEveryplayWithPath:] + 192
16  Project                         0x101422f98 -[Everyplay showEveryplay] + 108
17  Project                         0x100268700 -[GameViewController notificationHandler:] (GameViewController.mm:577)

好吧,在看到上面的崩溃日志之后,它与与 Everyplay 相关的设备方向处理有关。我们的游戏只在横向模式下进行,所以我认为纵向方向也是必需的。在 .plist 中添加两个纵向确实解决了这个问题。Everyplay 的视图控制器似乎需要这样的定义。

不确定其他iOS版本,其他设备是否会出现问题。感觉就像一个黑客。你怎么看?

4

0 回答 0