I just copied/pasted this code from the apple dev libary into xcode, and xcode gives me a lot of basic syntax errors..
- (void) authenticateLocalPlayer
{
GKLocalPlayer *localPlayer = [GKLocalPlayer localPlayer];
localPlayer.authenticateHandler = ^(UIViewController *viewController, NSError *error){
if (viewController != nil)
{
[self showAuthenticationDialogWhenReasonable: viewController
}
else if (localPlayer.isAuthenticated)
{
[self authenticatedPlayer: localPlayer];
}
else
{
[self disableGameCenter];
}
}];
}
Am I doing something wrong?
I suspect that you need to be targeting iOS6 and are not. My compiler also generates errors if I target iOS 5.x. Docs state that availability of the @property authenticateHandler is iOS6 only.
Also, syntax error missing closing bracket and semicolon after viewController in the first if clause of the block.