我是 cocos2dx 的基础。我正在使用“UIviewcontroller”如下
-(void)showLeaderBoar:(NSString*) category
{
GKLeaderboardViewController *leaderboad=[[GKLeaderboardViewController alloc] init];
if(leaderboad!=nil)
{
UIWindow *window=[[UIApplication sharedApplication]keyWindow];
UIViewController * currentModalViewController=[[UIViewController alloc]init];
[window addSubview:currentModalViewController.view];
leaderboad.category=category;
leaderboad.timeScope=GKLeaderboardTimeScopeAllTime;
leaderboad.leaderboardDelegate=self;
[[LeaderBoardManager sharedManager] reportScore:10000 forCategory:category];
[currentModalViewController presentModalViewController:leaderboad animated:YES];
}
[leaderboad release];
}
-(void) leaderboardViewControllerDidFinish:(GKLeaderboardViewController *)viewController
{
[viewController dismissModalViewControllerAnimated:YES];
[viewController release];
}
当我第一次运行并单击排行榜按钮时,我可以获得,但下次我单击时,我无法调用此函数。谁能指出我的错误?谢谢你的建议。