简体   繁体   中英

GKMatchmakerViewController delegate methods not being called

I spent hours trying to debug this one so I thought I'd post here to help perhaps save someone the headache!

GKMatchRequest *matchRequest = [[GKMatchRequest alloc] init];
matchRequest.minPlayers = 2;
matchRequest.maxPlayers = 2;
GKMatchmakerViewController *controller = [[GKMatchmakerViewController alloc] initWithMatchRequest:matchRequest];
controller.delegate = self;

The solution was that I was missing the fact that the controller delegate is not the correct delegate to set! Use matchmakerDelegate and all will be well!

controller.matchmakerDelegate = self;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM