1
이 코드 모든 게임 센터 친구를 검색 할 수있는 온라인 게임 센터 친구 ...아이폰 OS : ...하지만, 전용 GameKit과 친구를 검색 할 수있는 방법이
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);
}
}];
}
}];
}
가 불러 오기 온라인?
가능한 중복 : http://stackoverflow.com/questions/3781195/how-do-i-get-a-gkplayers-status-from-game-center – giacomelli
나는 이것이 확신 아니에요 중복. status 속성은 플레이어가 온라인 상태인지 여부를 알려줍니다. –