gpt4 book ai didi

objective-c - 为什么 GKPlayerAuthenticationDidChangeNotificationName 是 "undeclared identifier"

转载 作者:行者123 更新时间:2023-11-29 13:39:42 24 4
gpt4 key购买 nike

无数 GameCenter 教程都是这样做的:

 [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(localUserAuthenticationChanged) name:GKPlayerAuthenticationDidChangeNotificationName object:nil];

我有其他标准的 GameCenter 方法来验证用户等,但我想在应用程序处于后台时收到游戏中心登录更改的通知;根据很多书,网上的提示,上面的代码行就是你怎么听的。

但我无法构建该应用程序。它声称 name:GKPlayerAuthenticationDidChangeNotificationName 是一个未声明的标识符...这个,在其他 GameCenter 代码工作正常之后(并且确实导入了库和框架)。

知道我的 name:GKPlayerAuthenticationDidChangeNotificationName 出了什么问题吗?

最佳答案

您应该在包含该代码的文件中导入游戏套件。

关于objective-c - 为什么 GKPlayerAuthenticationDidChangeNotificationName 是 "undeclared identifier",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9496928/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com