这是我的 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 的教程进行操作:
但是后来,连matchmakerviewcontroller都没有出现。我不知道我做错了什么。
提前致谢。