我得到错误:
错误域= GKErrorDomain代码= 27“由于您尚未登录iCloud,所以无法完成请求的操作” UserInfo = 0x1889f160 {NSLocalizedDescription =由于您尚未登录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);
}
}];
Run Code Online (Sandbox Code Playgroud)
更为奇怪的是,它已经在两个星期前生效了,所以我将其注释掉并开始编写其他内容:排行榜,应用内购买–以及所有这些工作。
我正在登录到Game Center和iCloud的iPhone(iOS 8.1.3)上对其进行测试,我已打开iCloud Drive,但无法保存。我什至设置了一个新的测试帐户,但结果相同。
是否可以在同一测试帐户上测试所有这些功能,否则会导致此问题,还是该联系Apple了?
通过JavaScript更改DIV的类很有效,直到我通过更改该DIV的样式属性来"中断它".
案例0:更改为400
案例1:更改为600
案例2:不起作用!
为什么?
<!DOCTYPE html>
<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<style type="text/css">
.pos1 {left: 200px; top:400px;}
.pos2 {left: 400px; top:400px;}
.pos3 {left: 800px; top:400px;}
</style>
</head>
<body>
<div id = "img" class = "pos1" style="position:absolute;"> <img src="gfx/1n.png"> </div>
<script type="text/javascript">
var action = 0;
window.onmousedown = function(event){makeAction();}
function makeAction() {
switch(action) {
case 0: action++; document.getElementById('img').className = "pos2"; break
case 1: action++; document.getElementById('img').style.left = "600px"; break;
case 2: action++; document.getElementById('img').className = "pos3"; break;
}
}
</script> …Run Code Online (Sandbox Code Playgroud)