0
我加入遊戲中心功能,我的應用程序,我遇到了一些奇怪的事情,我不能避開我的頭......GameCenter的報告得分 - 本地聲明隱藏實例變量
我用這個確切的方法(和代碼)在5場比賽,所以我不明白爲什麼它現在拋出一個警告信息...
我得到2x「局部聲明的'分數'隱藏實例變量」在ReportScore
方法。 ...
的代碼如下:
-(void)reportScore{
GKScore *score = [[GKScore alloc] initWithLeaderboardIdentifier:_leaderboardIdentifier];
score.value = gameScore; //gameScore is games Score that needs submitting
[GKScore reportScores:@[score] withCompletionHandler:^(NSError *error) {
if (error != nil) {
NSLog(@"%@", [error localizedDescription]);
}
}];
}
我已經試過聲明這樣的變量在.h
:
@property (nonatomic) GKScore *score;
但是,引入了一個autosynthesised
警告,而不是...我不明白爲什麼當它不在我的任何其他應用程序中這樣做時發生這種情況?