无法保存游戏数据,因为 "not signed in to iCloud" 尽管我已签名

can't saveGameData because "not signed in to iCloud" although I am signed

我收到错误:

Error Domain=GKErrorDomain Code=27 "The requested operation could not be completed because you are not signed in to iCloud" UserInfo=0x1889f160 {NSLocalizedDescription=The requested operation could not be completed because you are not signed in to iCloud}

当我尝试使用这个明显的代码保存游戏数据时:

[[GKLocalPlayer localPlayer] saveGameData:serializedData withName:@"SaveName" completionHandler:^(GKSavedGame *savedGame, NSError *error) {
if (savedGame != nil) {
    NSLog(@"Player data saved to GameCenter: %@", savedGame);
} else {
    NSLog(@"Player data NOT saved to GameCenter, error: %@",  error.description);
}
}];

这更奇怪,因为 它在两周前起作用,所以我将其注释掉并开始编写其他内容:排行榜、应用程序内购买 – 以及所有这些工作。

我正在我的 iPhone (iOS 8.1.3) 上测试它,登录到 Game Center,到 iCloud,我打开了 iCloud Drive,但无法保存.我什至设置了一个新的测试帐户,但结果相同。

在同一个测试帐户上测试所有这些功能是否会导致此问题,或者是时候联系 Apple 了?

我遇到了同样的问题。

尝试使用您的标准帐户(不是 TestUser)登录 icloud。 在功能中激活 iCloud > iCloud 文档。在 Phone 设置(设备)中打开 iCloud Drive,它应该可以工作。

有同样的问题。我确实添加了 iCloud Capabilities,但只是在 ReleaseForProfiling 中错误地添加了。我应该在 ALL 部分进行。