openfeint 解锁成就调用的选择器无法识别

发布于 2024-10-14 11:09:15 字数 445 浏览 1 评论 0原文

我按照预期使用该调用,但它会导致崩溃。

//someId is a correct achievement ID
[OFAchievementService unlockAchievement:@"someId"];

我收到以下错误

由于未捕获的异常“NSInvalidArgumentException”而终止应用程序,原因:“+[OFAchievementServiceunlockAchievement:]:无法识别的选择器发送到类 0x26f1c8”

我还收到警告

警告:“OFAchievementService”可能不会响应“+unlockAchievement:”

应该如何调用此函数?根据示例,这看起来是正确的。

I use the call as it is supposed to be used, but it causes a crash.

//someId is a correct achievement ID
[OFAchievementService unlockAchievement:@"someId"];

and I get the following error

Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[OFAchievementService unlockAchievement:]: unrecognized selector sent to class 0x26f1c8'

I also get a warning

warning: 'OFAchievementService' may not respond to '+unlockAchievement:'

How is one supposed to call this function? This looks correct according to examples.

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

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

发布评论

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

评论(2

泅人 2024-10-21 11:09:15

尝试:

OFAchievementService *openfeint = [[OFAchievementService alloc] init];
[openfeint unlockAchievement:@"someId"];
[openfeint release];

实例方法以 - 开头,类级别方法以 + 开头。

使用 OpenFeint SDK 2.7+ 尝试:

/* The following example shows how to unlock an achievement completely in one step without bothering to show a notification: */
[[OFAchievement achievement: achievementId] updateProgressionComplete: 100.0f andShowNotification: NO];

Try:

OFAchievementService *openfeint = [[OFAchievementService alloc] init];
[openfeint unlockAchievement:@"someId"];
[openfeint release];

instance methods begin with - class level methods begin with +.

With OpenFeint SDK 2.7+ try:

/* The following example shows how to unlock an achievement completely in one step without bothering to show a notification: */
[[OFAchievement achievement: achievementId] updateProgressionComplete: 100.0f andShowNotification: NO];
半窗疏影 2024-10-21 11:09:15

以下行对我来说效果很好(在 OpenFeint SDK 版本 2.10i 中):

[[OFAchievement achievement:@"achievementID"] unlock];

The following line just worked well enough for me (in OpenFeint SDK version 2.10i):

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