Game Development Reference
that's sent through NSNotificationCenter . You register a selector to receive the
if (isGameCenterAvailable == NO)
NSNotificationCenter* nc = NSNotificationCenter.defaultCenter;
As you can see, isGameCenterAvailable is used here to skip the rest of the
method in case Game Center isn't available. You'll notice other methods doing the
same thing, and I'll refrain from repeating this in the topic's code.
The actual method being called by NSNotificationCenter simply forwards the
message to the delegate, but only if the delegate implements the onLocalPlayer-
AuthenticationChanged message. Because the GameKitHelper delegate
methods are marked as @optional , this precaution is necessary to avoid crashes.
if ([delegate respondsToSelector:@selector(onLocalPlayerAuthenticationChanged)])
Note The local player's signed-in status may actually change while the game is
in the background and the user runs the Game Center app and signs out. That's