游戏中心成就解锁
我想将成就添加到我的应用程序中。我在itunesconnect中添加了一个成就,并在参考库中找到了这个方法:
-(void) reportAchievementIdentifier: (NSString*) identifier percentComplete: (float) percent {
GKAchievement *achievement = [[[GKAchievement alloc] initWithIdentifier: identifier] autorelease];
if (achievement)
{
achievement.percentComplete = percent;
[achievement reportAchievementWithCompletionHandler:^(NSError *error)
{
if (error != nil)
{
// Retain the achievement object and try again later (not shown).
}
}];
} }
所以我将其添加到我的应用程序中。现在我希望当 int 值为 5 时解锁成就。 当 int 为 5 时,一个方法怎么会解锁这个成就呢?
I want to add achievements to my app. I added a achievement in itunesconnect and found this method in the reference library:
-(void) reportAchievementIdentifier: (NSString*) identifier percentComplete: (float) percent {
GKAchievement *achievement = [[[GKAchievement alloc] initWithIdentifier: identifier] autorelease];
if (achievement)
{
achievement.percentComplete = percent;
[achievement reportAchievementWithCompletionHandler:^(NSError *error)
{
if (error != nil)
{
// Retain the achievement object and try again later (not shown).
}
}];
} }
so I added this to my app. now I want that the achievement is unlocked when an int has the value 5.
how could a method look like that unlocks this achievement when the int is 5?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这将是:
it would be: