更新到gpg.framework ver 4.1.1后,我发现GPGAppstateModel不再存在,因此iOS游戏中的某些命令会返回错误。 我用来在游戏中加载令牌的代码示例:
GPGAppStateModel *model = [GPGManager sharedInstance].applicationModel.appState;
NSNumber *totalTokensKey = [NSNumber numberWithInt:CloudSaveKey_TotalTokens];
[model loadForKey:totalTokensKey completionHandler:^(GPGAppStateLoadStatus status, NSError *error) {
if (status == GPGAppStateLoadStatusNotFound) {
// Data for this key does not exist. This must be the first time our user
// played this game
NSLog(@"Total tokens does not exist");
} else {}
}
无论如何我可以解决这个问题吗?