My IDE show warning "Obsolete: Deprecated in iOS 7.0"
this methods:
- (GKScore) ReportScore()
- (GKAchievement) ReportAchievement()
This methods it works on iOS 7, but use not problem?
Exist other methods on iOS 7?
Thanks!
My IDE show warning "Obsolete: Deprecated in iOS 7.0"
this methods:
This methods it works on iOS 7, but use not problem?
Exist other methods on iOS 7?
Thanks!
I used this method to report score in game center and it works.
-(void)reportScore
{
if(isIOS7)
{
// Create a GKScore object to assign the score and report it as a NSArray object.
GKScore *score = [[GKScore alloc] initWithLeaderboardIdentifier:_leaderboardIdentifier];
score.value = _score;
[GKScore reportScores:@[score] withCompletionHandler:^(NSError *error) {
if (error != nil) {
NSLog(@"score reporting error : %@", [error localizedDescription]);
}
else
{
NSLog(@"score reported.");
}
}];
}
else
{
GKScore *scoreReporter = [[GKScore alloc] initWithCategory:_leaderboardIdentifier];
scoreReporter.value = _score;
scoreReporter.context = 0;
[scoreReporter reportScoreWithCompletionHandler:^(NSError *error) {
// Do something interesting here.
if (error != nil) {
NSLog(@"score reporting error : %@", [error localizedDescription]);
}
else
{
NSLog(@"score reported.");
}
}];
}
}
Objective-C methods start with a lower-case method. They are not called with rounded brackets. So, I:
GKScore
;-reportScoreWithCompletionHandler:
;+reportScores: withCompletionHandler:
isn't deprecated.And saw pretty much the same thing with the singular instance method being deprecated in favour of the collection class method in GKAchievement
.
So: just use the collection methods. Deprecated methods hang around being unsupported for a while and then disappear. You can find out what's currently supported, very very quickly, by reading the documentation.