Gamecenter Matchmaking不起作用

时间:2012-09-05 13:01:23

标签: objective-c ios cocos2d-iphone game-center gkmatchmaker

这是我的Menu.m的onEnter方法:

GKMatchRequest *request = [[[GKMatchRequest alloc] init] autorelease];
request.minPlayers = 2;
request.maxPlayers = 2;
GKMatchmakerViewController *mmvc = [[[GKMatchmakerViewController alloc] initWithMatchRequest:request] autorelease];
mmvc.matchmakerDelegate = self;

tempVC = [[UIViewController alloc] init];
[[[CCDirector sharedDirector] view] addSubview:tempVC.view];
[tempVC presentModalViewController: mmvc animated: NO];
mmvc.view.frame = CGRectMake(150, 150, 510, 420);

我尝试使用设备和模拟器,但它们无法匹配。

我也是按照Ray Wenderlich的tutorial

来做的

但是,即便是matchmakerviewcontroller也没出现。我不知道我做错了什么。

提前致谢。

1 个答案:

答案 0 :(得分:3)

您使用的是两个不同的游戏中心ID - 一个用于模拟器,一个用于您的设备?

您的设备是否已登录游戏中心沙箱?

模拟器将使用游戏中心沙箱,您的设备还必须使用沙箱进行连接。

您可以登出游戏中心登录游戏中心沙箱,然后启动您的应用。您的应用应该要求您登录游戏中心。通过未发布的应用程序执行登录将使您进入游戏中心沙箱。

相关问题