OpenFeint 成就百分比增量

发布于 2024-10-30 22:20:32 字数 1207 浏览 0 评论 0原文

我正在制作一个启用 OpenFeint 的 iOS 应用程序。 我已经成功地实现了除一项成就之外的所有成就。这项成就是部分完成的。

我的具体问题是我还没有找到一个可行的解决方案来将 1% 添加到当前的成就百分比。

我找到了这个值(它应该是一个double):

double achievement12 = [OFAchievementService getPercentComplete:ach12Id 
                                                        forUser:[OpenFeint lastLoggedInUserID]];

但这会导致以下错误和警告:

“无法在初始化时将 'objc_object*' 转换为 'double'。

“OpenFeint”可能不会响应“+lastLoggedInUserId”

“OFAchievementService”可能不会响应“+getPercentComplete:forUser:”

实际的功能代码是:

    // Note: this should be moved into public API
   + (double) getPercentComplete:(NSString*)achievementId forUser:(NSString*)userId
    {
        sAlreadyAtLeastPartlyCompleteQuery.bind("achievement_definition_id", achievementId);
        sAlreadyAtLeastPartlyCompleteQuery.bind("user_id", userId);     
        sAlreadyAtLeastPartlyCompleteQuery.execute();
        float percentComplete = (double)    (sAlreadyAtLeastPartlyCompleteQuery.getDouble("percent_complete"));
    sAlreadyAtLeastPartlyCompleteQuery.resetQuery();
    return percentComplete;
    }

这是最后一件事我必须在这个应用程序上做一些事情,它已经困扰我几天了。

I'm making an iOS app which is OpenFeint enabled.
I have managed to get all but one achievement to work. This one achievement is a partially completed one.

My specific problem is that I haven't found a working solution to add 1% to the current achievement percentage.

I found this value (it's supposed to be a double):

double achievement12 = [OFAchievementService getPercentComplete:ach12Id 
                                                        forUser:[OpenFeint lastLoggedInUserID]];

but this causes the following errors and warnings:

"Cannot convert 'objc_object*' to 'double' in initialization.

'OpenFeint' may not respond to "+lastLoggedInUserId"

'OFAchievementService' may not respond to "+getPercentComplete:forUser:"

The actual function code is:

    // Note: this should be moved into public API
   + (double) getPercentComplete:(NSString*)achievementId forUser:(NSString*)userId
    {
        sAlreadyAtLeastPartlyCompleteQuery.bind("achievement_definition_id", achievementId);
        sAlreadyAtLeastPartlyCompleteQuery.bind("user_id", userId);     
        sAlreadyAtLeastPartlyCompleteQuery.execute();
        float percentComplete = (double)    (sAlreadyAtLeastPartlyCompleteQuery.getDouble("percent_complete"));
    sAlreadyAtLeastPartlyCompleteQuery.resetQuery();
    return percentComplete;
    }

This is the last thing I have to do on this app, and it has been bugging me for a few days now.

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

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

发布评论

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

评论(2

醉态萌生 2024-11-06 22:20:32

确认NSSString成就ID是正确的,我认为它返回一个int,而不是双精度。

使用 OpenFeint 获取当前成就进度

Confirm that the NSSString achievement id is correct and I think it returns an int, not a double.

Using OpenFeint to get current Achievement progression

幻梦 2024-11-06 22:20:32

OpenFeint 支持人员表示,由于安全问题,他们尚未集成该部分。

话虽如此,我现在已经诉诸于存储一个包含数据的文件,以便以后可以检索它(当然使用方程式来隐藏真实值)

OpenFeint support said that they have not integrated that part due to security issues.

With that said, i have now resorted to storing a file with the data in so i can retrieve it later (using an equation to hide the real value of course)

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