Hi guys, I'm trying to implement Game Center in my game but met a little problem. I made a game center menu in my game with 2 buttons for the leader board and achievements. I'm trying to open the respective game center tabs when you hit those buttons the same way Openfeint does it but haven't been successful so far. I can load the tabs but always get redirected to a debug menu when trying to leave the tabs and go back to my menu. Did anyone encountered the same problem? Or someone has the time to give me a link with a step by step procedure? Thanks a lot.
Wasn't there an open source Game Center implementation of like a pong game in this very forum? I'd start with that.
I am looking deep... deep into my crystal ball... deeeeepppp.... I see in my mind's eye that you forgot to implement the Delegate Selectors... You'll need these in your class: Code: - (void)leaderboardViewControllerDidFinish:(GKLeaderboardViewController *)viewController { [self dismissModalViewControllerAnimated: YES]; [viewController release]; } - (void)achievementViewControllerDidFinish:(GKAchievementViewController *)viewController; { [self dismissModalViewControllerAnimated: YES]; [viewController release]; } You'll need to implement the delegate interfaces in the header for the class: Code: @interface MyClass : GKLeaderboardViewControllerDelegate, GKAchievementViewControllerDelegate> Then you'll need to make sure you set the delegate class when you launch the UIs: Code: GKLeaderboardViewController *leaderboardController = [[GKLeaderboardViewController alloc] init]; if (leaderboardController != NULL) { leaderboardController.category = self.currentLeaderBoard; leaderboardController.timeScope = GKLeaderboardTimeScopeAllTime; leaderboardController.leaderboardDelegate = self; // MAKE SURE YOU HAVE THIS! [self presentModalViewController: leaderboardController animated: YES]; } My spherical hunk of glass seems to think that will fix you up.
Thanks to you both for the answers! I will check right away. My programming skills have been buried for almost a decade so please excuse my poor soul @thewiirocks: I surely need one of those crystal ball myself. It would make my life a lot easier and not only for the code part
hi, can you help me with my integrations : ) - I tried to have GameCenter.mm and GameCenter.h with all functions and delegate - but how to call functions from other .m files? for example I have main app delegate class and function on_app_did_finish_load and need to call a function like ShowLeaderboard etc from here? - is that possible to have all GC functions in main app delegate instead separate GameCenter.mm and GameCenter.h files ? but then I have "self is undeclared" issues and can't close leaderboard view and assign delegate plz help me, it will be paid help: http://www.stonetrip.com/developer/forum/viewtopic.php?f=30&t=22335&p=29700#p29700