1

I finished my game in Sprite Kit and am now trying to store the highscore in GameCenter's Leaderboards. I followed some tutorials that worked great for none-spritekit-projects. Steps to my error:

  1. I debug my app without any errors, some warnings but they do no harm.
  2. App runs great, and my starting SKActions work flawless.
  3. I log in to GameCenter succesfully.
  4. When I touch the screen it freezes and gives me a "Missed Method" log error and "Thread 1:EXC_BAD_ACCESS (code=1, address=0x80000012)". Whenever I delete the line of code causing the BAD_ACESS error it pops up some other place in my code.

My Log:

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)

Does anyone have any clue whats going on? Or does someone have a step-by-step tutorial on how to integrate GameCenter Leaderboards into a sprite kit project?

rmaddy
  • 314,917
  • 42
  • 532
  • 579
Henk de B
  • 55
  • 1
  • 8
  • Look in any .h files that contain any optional methods for a protocol. Code will compile even if the optional method is not included in your protocol implementation, but you will get the 'Missed method' log message if the method is referenced elsewhere in a way that does not cause a compile error, but may cause a runtime error. This happened to me with Apple's GameCenterManager files. – GlennRay Nov 25 '14 at 00:15
  • Or you could add the optional methods to your implementation and just put an NSLog in each. Then, with breakpoints, you could trace back where the calls to each of those optional methods are coming from. – GlennRay Nov 26 '14 at 18:48

0 Answers0