i have this code for displaying leaderboard in the view
.h
UIViewController *presentingViewController;
{
@property (retain) UIViewController *presentingViewController;
.m
- (void)leaderboardViewControllerDidFinish:(GKLeaderboardViewController *)viewController
{
[presentingViewController dismissModalViewControllerAnimated:YES];
[self.presentingViewController.view removeFromSuperview];
}
- (void)leaderboard
{
GKLeaderboardViewController *lb = [[GKLeaderboardViewController alloc] init];
if(lb != nil){
lb.leaderboardDelegate = self;
presentingViewController = [[UIViewController alloc] init];
[[[[CCDirector sharedDirector] openGLView] window] addSubview:presentingViewController.view];
[presentingViewController presentModalViewController:lb animated:YES];
}
evey thing wok fine,it displayed the leadeboard,when i tap the done button it wil dissapear,but agian i tap the gamecentre button ,the leaderboard is not comes out,and we cant able to navigate through other pages also.
what is the problm with my above code,this is for iphone cocos2d app
Thanks in advance.
I used this code in cocos2D game and worked fine,