SIGABRT クラッシュが発生し、次のようなクラッシュが発生することがあります: GKScore には初期化された値が含まれている必要があります。
そのため、次の行まで追跡しました。
[localScore reportScoreWithCompletionHandler:^(NSError* error) {}];
localStore は次のように作成されます。
GKScore* localScore = [scores objectForKey:category];
-- カテゴリの由来は...
for (NSString* category in categories)
-- カテゴリの由来は...
[GKLeaderboard loadCategoriesWithCompletionHandler:^(NSArray *categories, NSArray *titles, NSError *error)
-(void) initScores
{
NSString* libraryPath = [NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES) objectAtIndex:0];
NSString* file = [libraryPath stringByAppendingPathComponent:currentPlayerID];
file = [file stringByAppendingString:kScoresFile];
id object = [NSKeyedUnarchiver unarchiveObjectWithFile:file];
if ([object isKindOfClass:[NSMutableDictionary class]])
{
NSMutableDictionary* loadedScores = (NSMutableDictionary*)object;
scores = [[NSMutableDictionary alloc] initWithDictionary:loadedScores];
}
else
{
scores = [[NSMutableDictionary alloc] init];
}
//NSLog(@"scores initialized: %d", scores.count);
}
すべてのコードで申し訳ありませんが、ほとんどすべてのコードはこのライブラリのファイルからのものです: https://github.com/csddavies/DDGameKitHelper/blob/master/DDGameKitHelper.m
とにかく、どうすればこれを修正できますか?
ありがとう!!!