启动 OpenFeint 仪表板时发生崩溃

发布于 2024-09-11 16:18:34 字数 2486 浏览 13 评论 0原文

我最近尝试将 open feint 集成到我的应用程序中。当我的应用程序启动时,底部的“欢迎回来玩家 xxxx”会起作用,所以我知道开放假动作正在起作用。但是,当我按下链接到此的按钮时,

-(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'

我无法找到任何有关如何解决此问题的帖子,因此我们将不胜感激!提前致谢

I recently tried to integrate open feint into my app. When my app launches, the 'Welcome back player xxxx' at the bottom works so I know that open feint is working. However, when I press the button that has this linked to it

-(IBAction) leaderboard: (id) sender
{

 [OpenFeint launchDashboard];
}

I get this error:

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'

I haven't been able to find any post on how to resolve this so any help would be greatly appreciated! Thanks in advance

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

话少心凉 2024-09-18 16:18:34

从例外情况来看,在我看来,当该方法需要一个参数时,您试图使用 Leaderboard 向您的对象发送消息,因此您应该使用一个参数来调用它。

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

[someDemoAppViewControllerObject leaderboard]

当您应该这样做时:

[someDemoAppViewControllerObject leaderboard:theSenderObject]

通常 self 被用作 theSenderObject

From the exception it looks to me as if you tried to message your object with leaderboard when the method requires one argument and as such you should call it with one.

That is, it looks like you are doing something like this:

[someDemoAppViewControllerObject leaderboard]

When your should be doing this:

[someDemoAppViewControllerObject leaderboard:theSenderObject]

Quite often self is used as theSenderObject.

孤芳又自赏 2024-09-18 16:18:34

-(IBAction) leaderboard: (id) sender

在 .h 文件中声明的吗?

is

-(IBAction) leaderboard: (id) sender

declared in the .h file?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文