Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/121.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios SpriteKit中的GameCenter排行榜导致错误_Ios_Objective C_Sprite Kit_Unrecognized Selector_Game Center Leaderboard - Fatal编程技术网

Ios SpriteKit中的GameCenter排行榜导致错误

Ios SpriteKit中的GameCenter排行榜导致错误,ios,objective-c,sprite-kit,unrecognized-selector,game-center-leaderboard,Ios,Objective C,Sprite Kit,Unrecognized Selector,Game Center Leaderboard,我在Sprite Kit中完成了我的游戏,现在我正在尝试将最高分存储在GameCenter的排行榜中。我学习了一些对非spritekit项目非常有用的教程。纠正我的错误的步骤: 我调试我的应用程序没有任何错误,一些警告,但他们没有伤害 应用程序运行得很好,我的启动动作完美无瑕 我成功登录到游戏中心 当我触摸屏幕时,屏幕冻结,并显示“Missed Method”日志错误和“Thread 1:EXC_BAD_ACCESS(代码=1,地址=0x8000012)”。每当我删除导致坏访问错误的代码行时,它

我在Sprite Kit中完成了我的游戏,现在我正在尝试将最高分存储在GameCenter的排行榜中。我学习了一些对非spritekit项目非常有用的教程。纠正我的错误的步骤:

  • 我调试我的应用程序没有任何错误,一些警告,但他们没有伤害
  • 应用程序运行得很好,我的启动动作完美无瑕
  • 我成功登录到游戏中心
  • 当我触摸屏幕时,屏幕冻结,并显示“Missed Method”日志错误和“Thread 1:EXC_BAD_ACCESS(代码=1,地址=0x8000012)”。每当我删除导致坏访问错误的代码行时,它就会弹出代码中的其他位置
  • 我的日志:

    2014-04-21 19:51:26.893 Sharky[3417:60b] Missed Method 2014-04-21 19:51:27.683 Sharky[3417:60b] -[NSMethodSignature copyWithZone:]: unrecognized selector sent to instance 0xacbdc20 2014-04-21 19:51:27.685 Sharky[3417:60b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSMethodSignature copyWithZone:]: unrecognized selector sent to instance 0xacbdc20' *** First throw call stack: ( 0 CoreFoundation 0x0009c1e4 __exceptionPreprocess + 180 1 libobjc.A.dylib 0x019978e5 objc_exception_throw + 44 2 CoreFoundation 0x00139243 -[NSObject(NSObject) doesNotRecognizeSelector:] + 275 3 CoreFoundation 0x0008c50b ___forwarding___ + 1019 4 CoreFoundation 0x0008c0ee _CF_forwarding_prep_0 + 14 5 libobjc.A.dylib 0x019a9bcd -[NSObject copy] + 41 6 SpriteKit 0x01481f4c -[SKNode runAction:] + 55 7 Sharky 0x0000595c -[MyScene touchesBegan:withEvent:] + 476 8 SpriteKit 0x014702bf -[SKView touchesBegan:withEvent:] + 824 9 UIKit 0x00576c0b -[UIWindow _sendTouchesForEvent:] + 386 10 UIKit 0x005779d1 -[UIWindow sendEvent:] + 1117 11 UIKit 0x005495f2 -[UIApplication sendEvent:] + 242 12 UIKit 0x00533353 _UIApplicationHandleEventQueue + 11455 13 CoreFoundation 0x0002577f __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 15 14 CoreFoundation 0x0002510b __CFRunLoopDoSources0 + 235 15 CoreFoundation 0x000421ae __CFRunLoopRun + 910 16 CoreFoundation 0x000419d3 CFRunLoopRunSpecific + 467 17 CoreFoundation 0x000417eb CFRunLoopRunInMode + 123 18 GraphicsServices 0x03a7f5ee GSEventRunModal + 192 19 GraphicsServices 0x03a7f42b GSEventRun + 104 20 UIKit 0x00535f9b UIApplicationMain + 1225 21 Sharky 0x0000a472 main + 130 22 libdyld.dylib 0x023e4701 start + 1 23 ??? 0x00000001 0x0 + 1 ) libc++abi.dylib: terminating with uncaught exception of type NSException (lldb) 2014-04-21 19:51:26.893 Sharky[3417:60b]漏掉的方法 2014-04-21 19:51:27.683 Sharky[3417:60b]-[NSMethodSignature copyWithZone:]:发送到实例0xacbdc20的选择器无法识别 2014-04-21 19:51:27.685 Sharky[3417:60b]***由于未捕获的异常“NSInvalidArgumentException”而终止应用程序,原因:'-[NSMethodSignature copyWithZone::]:未识别的选择器发送到实例0xacbdc20' ***第一次抛出调用堆栈: ( 0 CoreFoundation 0x0009c1e4例外预处理+180 1 libobjc.A.dylib 0x019978e5 objc_异常_抛出+44 2 CoreFoundation 0x00139243-[NSObject(NSObject)不识别选择器:+275 3 CoreFoundation 0x0008c50b\uuuuuuuuuuuuuuuu+1019 4 CoreFoundation 0x0008c0ee\u CF\u转发\u准备\u 0+14 5 libobjc.A.dylib 0x019a9bcd-[NSObject copy]+41 6 SpriteKit 0x01481f4c-[SKNode运行操作:][55 7 Sharky 0x0000595c-[MyScene TouchesBegind:withEvent:][476 8 SpriteKit 0x014702bf-[SKView TouchesBegind:withEvent:][824 9 UIKit 0x00576c0b-[UIWindow\u sendTouchesForEvent:+386 10 UIKit 0x005779d1-[UIWindow sendEvent:+1117 11 UIKit 0x005495f2-[UIApplication sendEvent:+242 12 UIKit 0x00533353 _UIApplicationHandleEventQueue+11455 13 CoreFoundation 0x0002577f\uuuu CFRUNLOOP\u正在调用\uu OUT\uu以执行\uu函数\uuuu+15 14 CoreFoundation 0x0002510b_uuCFRUNLOOPDOSources0+235 15 CoreFoundation 0x000421ae _ucfrunlooprun+910 16 CoreFoundation 0x000419d3 CFRunLoopRunSpecific+467 17 CoreFoundation 0x000417eb CFRunLoopRunInMode+123 18图形服务0x03a7f5ee GSEventRunModal+192 19图形服务0x03a7f42b GSEventRun+104 20 UIKit 0x00535f9b UIApplicationMain+1225 21 Sharky 0x0000a472干管+130 22 libdyld.dylib 0x023e4701开始+1 23°?0x00000001 0x0+1 ) libc++abi.dylib:以NSException类型的未捕获异常终止 (lldb)
    有人知道发生了什么事吗?或者有人有关于如何将GameCenter排行榜集成到sprite工具包项目中的分步教程吗?

    查看包含协议可选方法的任何.h文件。即使可选方法未包含在协议实现中,代码也会编译,但如果在其他地方引用该方法时不会导致编译错误,但可能会导致运行时错误,则会收到“Missed method”日志消息。苹果的GameCenterManager文件就是这样。或者你可以在实现中添加可选方法,只需在每个方法中添加一个NSLog。然后,通过断点,您可以追溯到每个可选方法的调用来自何处。