GameKit 框架有错误或过时?

发布于 2024-12-21 01:09:27 字数 963 浏览 6 评论 0原文

我目前正在应用程序上实施游戏中心。我已经遵循了这个教程 教程 1 和这个 教程 2 他们都有这个GKLocalPlayer 线

[GKLocalPlayer localPlayer]

我缓慢而坚定地遵循这些步骤,但每次我编译我的作品时,我都会

在 GK 中对此 GKLocalPlayer 进行底层声明GKScore 以及其他一些。

我想知道我的游戏套件框架是否有问题?

我似乎无法找到问题,因为尝试这些教程的其他人都成功解决了问题。

这是包含 GKLocalPlayer 的代码的一部分(在教程1中):

- (void) authenticateLocalUser
{
    if([GKLocalPlayer localPlayer].authenticated == NO)
    {
        [[GKLocalPlayer localPlayer] authenticateWithCompletionHandler:^(NSError *error) 
         {
             [self callDelegateOnMainThread: @selector(processGameCenterAuth:) withArg: NULL error: error];
         }];
    }
}

PS:我的模拟器是ios4.0,我的xcode是3.2.3

I am currently working on game center implementation on an app. i have followed this tuto Tutorial 1 and this Tutorial 2 both of them have this GKLocalPlayer line

[GKLocalPlayer localPlayer]

i followed the steps slowly and surely but everytime i compile my work im having this

GKLocalPlayer underclared and GKScore and some other in GK.

i am wondering is there something wrong in my Game Kit Framework?

i cant seem to find the problem because others who tried those tutorials got it successfully.

here is a part of the code which includes the GKLocalPlayer (in tutorial1):

- (void) authenticateLocalUser
{
    if([GKLocalPlayer localPlayer].authenticated == NO)
    {
        [[GKLocalPlayer localPlayer] authenticateWithCompletionHandler:^(NSError *error) 
         {
             [self callDelegateOnMainThread: @selector(processGameCenterAuth:) withArg: NULL error: error];
         }];
    }
}

PS: my simulator is ios4.0 my xcode is 3.2.3

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

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

发布评论

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

评论(1

为你鎻心 2024-12-28 01:09:27

GKLocalPlayer (为您链接的文档)是在 iOS 4.1 中引入的,其余部分游戏套件功能

针对 iOS 4.1 及更高版本,请确保您的项目中包含 GameKit 框架,如果您遇到相同的问题,请告诉我们。

GKLocalPlayer (documentation linked for you) was introduced with iOS 4.1, as was the rest of the Game Kit functionality.

Target iOS 4.1 and newer, make sure you have the GameKit framework included in your project, and let us know if you have the same problems.

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