質問編集履歴

1

コードを修正しました

2015/11/03 13:18

投稿

ababab
ababab

スコア47

test CHANGED
File without changes
test CHANGED
@@ -40,28 +40,28 @@
40
40
 
41
41
  -(void)score{
42
42
 
43
- GKScore *scoreReporter = [[GKScore alloc] initWithCategory:@"itunes connectで作ったLeaderboard ID"];
43
+ if ([GKLocalPlayer localPlayer].isAuthenticated) {
44
44
 
45
- NSInteger scoreR;
45
+ GKScore* score = [[GKScore alloc] initWithLeaderboardIdentifier:@"achievement"];
46
46
 
47
- scoreR=スコアの値;
47
+
48
48
 
49
- scoreReporter.value = scoreR;
49
+ score.value = 100.0;
50
50
 
51
- [scoreReporter reportScoreWithCompletionHandler:^(NSError *error) {
51
+ [GKScore reportScores:@[score] withCompletionHandler:^(NSError *error) {
52
52
 
53
- if (error != nil)
53
+ if (error) {
54
54
 
55
- {
56
-
57
- // 報告エラーの処理
55
+ // エラーの場合
58
-
59
- NSLog(@"error %@",error);
60
56
 
61
57
  }
62
58
 
63
59
  }];
64
60
 
61
+ }
62
+
63
+
64
+
65
65
  }
66
66
 
67
67
  ```