GameCenter的奇怪例外 [英] Strange Exception with GameCenter

查看:150
本文介绍了GameCenter的奇怪例外的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直收到来自GA和用户的崩溃报告......但是我无法通过ios7和ios8测试iphone5,5s,6来重现此异常。当应用程序进入后台时,此问题无处可去。奇怪的是游戏中心会调用spritekit来显示成就横幅?

I keep getting this crash report from GA and users... However i cannot reproduce this exception by testing iphone5,5s,6 with both ios7 and ios8. This issue comes nowhere when application did enter to background. The strange part is that gamecenter will call spritekit, for showing achievement banner?

有没有人遇到同样的问题?

Does anyone has the same issue?

Last Exception Backtrace:
0   CoreFoundation                  0x23c99e3f __exceptionPreprocess + 127
1   libobjc.A.dylib                 0x31371c8b objc_exception_throw + 38
2   CoreFoundation                  0x23c9f189 -[NSObject(NSObject) doesNotRecognizeSelector:] + 188
3   CoreFoundation                  0x23c9d0a7 ___forwarding___ + 714
4   CoreFoundation                  0x23bcf208 _CF_forwarding_prep_0 + 24
5   SpriteKit                       0x26fe9689 -[SKNode isEqual:] + 164
6   Foundation                      0x248ec9ff +[NSObject(NSDelayedPerforming) cancelPreviousPerformRequestsWithTarget:] + 358
7   GameCenterFoundation            0x2a945873 -[GKPlayer postChangeNotification] + 38
8   GameCenterFoundation            0x2a958d21 __52-[GKDaemonProxy setLocalPlayer:authenticated:reply:]_block_invoke + 848
9   libdispatch.dylib               0x318d18cb _dispatch_call_block_and_release + 10
10  libdispatch.dylib               0x318d18b7 _dispatch_client_callout + 22
11  libdispatch.dylib               0x318d50bf _dispatch_main_queue_callback_4CF + 722
12  CoreFoundation                  0x23c5fbe9 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 8
13  CoreFoundation                  0x23c5e2e9 __CFRunLoopRun + 1512
14  CoreFoundation                  0x23bac621 CFRunLoopRunSpecific + 476
15  CoreFoundation                  0x23bac433 CFRunLoopRunInMode + 106
16  GraphicsServices                0x2af1b0a9 GSEventRunModal + 136
17  UIKit                           0x27197359 UIApplicationMain + 1440
18  MyAppName                       0x001b4f27 main (main.m:16)
19  libdyld.dylib                   0x318f1aaf start + 2

类似的崩溃问题HREF = https://stackoverflow.com/questions/25984424/ios8-gklocalplayerinternal-unrecognized-selector> iOS8上GKLocalPlayerInternal无法识别的选择器

我尝试过使用SKNode和GKPlayer的测试

I tried a test that using a SKNode and a GKPlayer

SKNode* node = [SKNode node];
GKPlayer* player = [GKLocalPlayer localPlayer];
[node isEqual:player];

这将导致以下异常与上述结果相同,这意味着系统将SKNode与[GKPlayer postChangeNotification] ....这真的很奇怪。

It will cause the following exception the same as the above result, which means the system compare the SKNode with [GKPlayer postChangeNotification]....It's really weird.

-[GKLocalPlayerInternal name]: unrecognized selector sent to instance 0x1b6e3f80


推荐答案

如果你说你可以通过简单地比较一个来复制崩溃任何GKLocalPlayer的SKNode然后似乎这是SpriteKit中的错误,因为对任何对象执行相等性检查不应该导致崩溃。

If as you say you can replicate the crash by simply comparing an SKNode with any GKLocalPlayer then it would seem that this is a bug in SpriteKit as performing an equality check on any object should not result in a crash.

如果你有耐力,你可以在你的应用程序中继承所有SKNode,并实现 isEqual 哈希方法你自己。这应避免对未实现该选择器的对象进行错误的名称比较检查。

If you have the stamina for it, you could subclass all the SKNode's in your app and implement the isEqual and hash methods yourself. This should avoid the faulty name comparison check on objects that do not implement that selector.

我还建议您将此报告为Apple的错误。

I would also recommend you report this as a bug to Apple.

这个问题似乎表明Apple确实更新了iOS8中的SKNode相等和散列方法,因此该错误可能是由于该更改引起的。

This question seems to indicate that Apple did indeed update SKNode equality and hashing methods in iOS8, so it is likely the bug was caused by that change.

这篇关于GameCenter的奇怪例外的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆