我尝试实现云消息传递,并面临一个问题,它使我的游戏终止。但我没有例子项目的这个问题。无法识别的选择器“fetchTokenWithAuthorizedEntity:scope:keyPair:options:handler:”in GG云消息传递
相关类的GGLInstanceIDTokenManager,它是libGGLInstanceIDLib.a lib中的私有类。下面是我看到的Xcode日志:
2015-06-16 18:13:04.446 BreezeGame[2307:427893] -[GGLInstanceIDTokenManager fetchTokenWithAuthorizedEntity:scope:keyPair:options:handler:]: unrecognized selector sent to instance 0x14681290
2015-06-16 18:13:04.713 BreezeGame[2307:427893] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[GGLInstanceIDTokenManager fetchTokenWithAuthorizedEntity:scope:keyPair:options:handler:]: unrecognized selector sent to instance 0x14681290'
为什么没有发现Xcode中fetchTokenWithAuthorizedEntity:范围:密钥对:选择:处理器:功能?
请帮我解决它。我是Cloud Messaging的新手。
你在项目中使用'CocoaPods'一个在GoogleService-Info.plist中?如果没有,您可以按照[本页](https://developers.google.com/cloud-messaging/ios/client)中的步骤进行操作。另外请确保您将'GoogleService-Info.plist'添加到您的项目中。 – ztan
是的,我遵循指南中的一步一步。并确定我添加了GoogleService-Info.plist。我也创建了一个新项目,并且它工作。所以我仍然不知道为什么没有Xcode找到这个功能?你知道有些事情会导致问题吗? –
我认为你在项目文件设置中缺少了-ObjC链接器标志。由于该方法是在类中定义的,并且如果您没有设置,链接器不会添加这些类别方法,并且它会失败。 这是关于这个http://stackoverflow.com/questions/2567498/objective-c-categories-in-static-library的更多信息 – evanescent