GameKit 框架有错误或过时?
我目前正在应用程序上实施游戏中心。我已经遵循了这个教程 教程 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
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.