0

我最近尝试将 open feint 集成到我的应用程序中。当我的应用程序启动时,底部的“Welcome back player xxxx”可以正常工作,所以我知道 open feint 可以正常工作。但是,当我按下链接到它的按钮时

-(IBAction) leaderboard: (id) sender
{

 [OpenFeint launchDashboard];
}

我收到此错误:

Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[DemoAppViewController leaderboard]: unrecognized selector sent to instance 0x7a40250'
*** Call stack at first throw:

(
 0   CoreFoundation                      0x02d71919 __exceptionPreprocess + 185
 1   libobjc.A.dylib                     0x02ebf5de objc_exception_throw + 47
 2   CoreFoundation                      0x02d7342b -[NSObject(NSObject) doesNotRecognizeSelector:] + 187
 3   CoreFoundation                      0x02ce3116 ___forwarding___ + 966
 4   CoreFoundation                      0x02ce2cd2 _CF_forwarding_prep_0 + 50
 5   UIKit                               0x00695e14 -[UIApplication sendAction:to:from:forEvent:] + 119
 6   UIKit                               0x0071f6c8 -[UIControl sendAction:to:forEvent:] + 67
 7   UIKit                               0x00721b4a -[UIControl(Internal) _sendActionsForEvents:withEvent:] + 527
 8   UIKit                               0x007206f7 -[UIControl touchesEnded:withEvent:] + 458
 9   UIKit                               0x006b92ff -[UIWindow _sendTouchesForEvent:] + 567
 10  UIKit                               0x0069b1ec -[UIApplication sendEvent:] + 447
 11  UIKit                               0x0069fac4 _UIApplicationHandleEvent + 7495
 12  GraphicsServices                    0x032f3afa PurpleEventCallback + 1578
 13  CoreFoundation                      0x02d52dc4 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 52
 14  CoreFoundation                      0x02cb3737 __CFRunLoopDoSource1 + 215
 15  CoreFoundation                      0x02cb09c3 __CFRunLoopRun + 979
 16  CoreFoundation                      0x02cb0280 CFRunLoopRunSpecific + 208
 17  CoreFoundation                      0x02cb01a1 CFRunLoopRunInMode + 97
 18  GraphicsServices                    0x032f22c8 GSEventRunModal + 217
 19  GraphicsServices                    0x032f238d GSEventRun + 115
 20  UIKit                               0x006a3b58 UIApplicationMain + 1160
 21  DemoApp                             0x00004f84 main + 102
 22  DemoApp                             0x00004f15 start + 53
)

terminate called after throwing an instance of 'NSException'

我还没有找到任何关于如何解决这个问题的帖子,所以任何帮助将不胜感激!提前致谢

4

2 回答 2

0

在我看来,leaderboard当方法需要一个参数时,您似乎尝试向对象发送消息,因此您应该用一个参数调用它。

也就是说,看起来你正在做这样的事情:

[someDemoAppViewControllerObject leaderboard]

当你应该这样做时:

[someDemoAppViewControllerObject leaderboard:theSenderObject]

经常self被用作theSenderObject.

于 2010-08-04T00:33:53.880 回答
0

-(IBAction) leaderboard: (id) sender

在.h 文件中声明?

于 2010-08-04T00:36:55.963 回答