Hello everyone,
I'm a newbie on both Sparrow and iPhone game development, so excuse me if this is a very basic question. I'm creating a simple game which needs access to the Game Center. I used the AppScaffold from the Sparrow distribution and made the class Game implement GKLeaderboardViewControllerDelegate. So, I also created a showLeaderboard and a leaderboardViewControllerDidFinish function.
When I call showLeaderboard after clicking a button, everything goes fine, the window appears with the scores. When I dismiss it using the "Done" button, the window is dismissed and disappears but I lose input on the window that was beneath. What am I doing wrong?
Code for showLeaderboard:
-(void) showLeaderboard { tempVC = [[UIViewController alloc] init]; GKLeaderboardViewController* leaderboardController = [[GKLeaderboardViewController alloc] init] autorelease]; if (leaderboardController != nil) { leaderboardController.leaderboardDelegate = self; [window addSubview:tempVC.view]; //Doesn't show up without this [tempVC presentModalViewController:leaderboardController animated:YES]; } }
Code for leaderboardViewControllerDidFinish:
-(void)leaderboardViewControllerDidFinish:(GKLeaderboardViewController*) viewController { [tempCV dismissModalViewControllerAnimated:YES]; [tempCV removeFromSuperview]; }
What am I doing wrong here? :\
Thanks in advance!