2011-12-09 7 views
6

에 대한 사진을로드 할 수 없습니다 나는 함수에 다음 코드를 사용하여 재귀 적으로 정의 리더에서 사진을로드 오전 : 우리는 그래서 우리는 현재 두 개의 장치에서 응용 프로그램을 테스트하는게임 센터는 여러 플레이어 ID를

-(void)loadPhotos { 
[((GKPlayer*)[players objectAtIndex:i]) loadPhotoForSize:GKPhotoSizeSmall withCompletionHandler: ^(UIImage *photo, NSError *error) { 

      if (error != nil) 
      { 

       NSLog(@"Error: %@", error); 
      } 
      if (photo != nil) 
      { 

       [friendPhotos addObject:photo]; 
       [globalTable reloadData]; 
       i++; 
       if (i< [players count]){ 
        [self loadPhotos]; 
       } 
      } 
     }]; 
} 

우리 샌드 박스 환경에서 2 명의 플레이어. 그러나 첫번째 선수에 대한 첫 번째 호출은 사진하지만 두 번째 사진은, 내가로드 할 수 없습니다로드하고, 나는 다음과 같은 오류 인쇄 :

Error: Error Domain=GKErrorDomain Code=3 "The requested operation could not be completed due to an error communicating with the server." UserInfo=0x1b19f0 {NSLocalizedDescription=The requested operation could not be completed due to an error communicating with the server.} 

어떤 제안?

ps. 또한 반복적으로 반복 해 보았습니다. 같은 오류, 나는 너무 자주 전화를했기 때문이라고 생각했다.

+0

플레이어는 GKLeaderboard 요청에서 반환 된 배열에서 초기화 된 플레이어 배열입니다. –

답변

1

이 오류 유형의 가능한 원인 중 하나는 올바른 포트 전달을 활성화하지 않았기 때문입니다. this Apple doc을 참조하십시오.