2010-03-17 3 views
1

방금 ​​네트워크가 중단되었을 때 Apple에서 제안한 코드가 이미지를로드하지 못하는 것으로 나타났습니다 ... 그러나네트워크 중단 후 모든 사용자의 이미지를로드하지 못합니까?

IconDownloader는 다음과 같은 경우에 아무 것도하지 않기 때문입니다. NSURL 연결이 실패합니다 ...

내가 혼자서 고민하기 전에 누구나 나를위한 조언이 있습니다. D?

고마워요,

안녕하세요.

답변

1

==> 내가이있는 NSURLConnection 방법은 연결 실패받을 경우 우리가 다운로드 할 수있는 일이라고 생각

- (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error 

{ 
      // Clear the activeDownload property to allow later attempts 
      self.activeDownload = nil; 

      // Release the connection now that it's finished 
     self.imageConnection = nil; 


    //i think we can call the connection method again from here 

     self.activeDownload = [NSMutableData data]; 
      // alloc+init and start an NSURLConnection; release on completion/failure 
     NSURLConnection *conn = [[NSURLConnection alloc] initWithRequest: 
         [NSURLRequest requestWithURL: 
          [NSURL URLWithString:appRecord.imageURLString]] delegate:self]; 
     self.imageConnection = conn; 
     [conn release]; 



} 
관련 문제