Reputation: 542
I am currently working on game center implementation on an app. i have followed this tuto Tutorial 1 and this Tutorial 2 both of them have this GKLocalPlayer line
[GKLocalPlayer localPlayer]
i followed the steps slowly and surely but everytime i compile my work im having this
GKLocalPlayer underclared and GKScore and some other in GK.
i am wondering is there something wrong in my Game Kit Framework?
i cant seem to find the problem because others who tried those tutorials got it successfully.
here is a part of the code which includes the GKLocalPlayer (in tutorial1):
- (void) authenticateLocalUser
{
if([GKLocalPlayer localPlayer].authenticated == NO)
{
[[GKLocalPlayer localPlayer] authenticateWithCompletionHandler:^(NSError *error)
{
[self callDelegateOnMainThread: @selector(processGameCenterAuth:) withArg: NULL error: error];
}];
}
}
PS: my simulator is ios4.0 my xcode is 3.2.3
Upvotes: 0
Views: 354
Reputation: 89509
GKLocalPlayer
(documentation linked for you) was introduced with iOS 4.1, as was the rest of the Game Kit functionality.
Target iOS 4.1 and newer, make sure you have the GameKit framework included in your project, and let us know if you have the same problems.
Upvotes: 1