2011-01-26 82 views
1

我使用调用,因为它应该被使用,但它会导致崩溃。无法识别的选择器到openfeint解锁成就调用

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

,我得到以下错误

终止应用程序由于未捕获的异常 'NSInvalidArgumentException',原因是: '+ [OFAchievementService unlockAchievement:]:无法识别的选择发送到类0x26f1c8'

我还收到警告

警告:'OFAchieveme ntService'可能不会响应'+ unlockAchievement:'

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

+0

什么OpenFeint的SDK版本您使用的? – 2011-01-26 22:51:19

+0

使用OpenFeint 12102010版(2.8)。 https://api.openfeint.com/ – jarryd 2011-01-26 22:53:57

回答

2

尝试:

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]; 
1

下面一行刚工作的很好,我(OpenFeint SDK版本2.10i):

[[OFAchievement achievement:@"achievementID"] unlock]; 
相关问题