Unrecognized selector to an openfeint unlock achievement call
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.
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];
The following line just worked well enough for me (in OpenFeint SDK
version 2.10i):
[[OFAchievement achievement:@"achievementID"] unlock];
精彩评论