我将 Game Center 实现到 iOS 应用程序中。
当从应用程序中打开游戏中心排行榜视图并按下“完成”按钮时,该视图不会消失。
下面是打开 Game Center 视图的代码:
GKGameCenterViewController gameCenter = new GKGameCenterViewController ();
gameCenter.ViewState = GKGameCenterViewControllerState.Leaderboards;
gameCenter.LeaderboardCategory = "myleaderboardddd";
gameCenter.LeaderboardTimeScope = GKLeaderboardTimeScope.AllTime;
gameCenter.Finished += delegate(object sender, EventArgs e) {
Console.WriteLine ("CLOSE THIS VIEW!"); // <-- THIS IS NEVER REACHED
this.DismissViewController(true, null);
};
this.PresentViewController (gameCenter, true, null);
请注意,按下完成按钮时永远不会到达 Console.WriteLine。
我做错了什么?