1
我可以檢索所有遊戲中心的好友與此代碼...的iOS:找回比賽中心的朋友誰是在線
GKLocalPlayer *lp = [GKLocalPlayer localPlayer];
if (lp.authenticated)
{
[lp loadFriendsWithCompletionHandler:^(NSArray *friends, NSError *error)
{
NSLog(@"MY FRIENDS: %@",friends);
if (friends != nil)
{
[GKPlayer loadPlayersForIdentifiers:friends withCompletionHandler:^(NSArray *players, NSError *error)
{
if (error != nil)
{
// Handle the error.
NSLog(@"PLAYERLIST ERROR: %@",[error localizedDescription]);
}
if (players != nil)
{
// Process the array of GKPlayer objects.
NSLog(@"PLAYERS: %@",players);
}
}];
}
}];
}
...但是,有沒有辦法只檢索與的GameKit誰是朋友在線?
可能重複:http://stackoverflow.com/questions/3781195/how-do-i-get-a-gkplayers-status-from-game-center – giacomelli 2013-05-09 15:45:51
我不相信這是一個副本。狀態屬性是否告訴玩家是否在線? – 2013-05-10 09:47:20