2012-11-26 2 views
1

내 앱에서 사용자 정의 UITableView 셀을 사용하고 있으며 LazyTableImages 샘플 코드를 통합하여 tableview에서 이미지를 다운로드했습니다. 나는 위의 코드는 모든 데이터를로드하지 않고, 내가 대신 Customcell의 UITableView 셀을 사용하는 경우 그것은, 어떤 생각을하고있다맞춤형 uitableviewcell이 LazyTableImages에서 작동하지 않습니다.

- (void)appImageDidLoad:(NSIndexPath *)indexPath 
    { 
     IconDownloader *iconDownloader = [imageDownloadsInProgress objectForKey:indexPath]; 
     if (iconDownloader != nil) 
     { 
      CustomTblViewCell *cell = (CustomTblViewCell *)[self.TblView cellForRowAtIndexPath:iconDownloader.indexPathInTableView]; 

      // Display the newly loaded image 
      cell.ImgViewUser.image = iconDownloader.appRecord.m_strImage; 
     } 

     // Remove the IconDownloader from the in progress list. 
     // This will result in it being deallocated. 
     [imageDownloadsInProgress removeObjectForKey:indexPath]; 
     [m_CtrlTblViewFacetoface reloadData ]; 
}

에서 아래의 코드를 사용하여 무엇입니까?

+1

"작동하지 않음"은 무엇을 의미합니까? 구체적으로 말하십시오. – rmaddy

+0

tableview가 완전 공백으로 나타나지 않음 – Vishnu

+0

실제로 lazyLoading에서 데이터를 가져 오는지 확인하십시오 ... – Rajneesh071

답변

0

단순히 내가 전에 그것을 라이브러리가 사용되며 잘 " SDWebImage는"당신은 단순히 방법으로 사용할 수 있습니다이라는 라이브러리 일 :

[cell.ImgViewUser setImageWithURL:[NSURL URLWithString:@"http://www.domain.com/path/to/image.jpg"] 
       placeholderImage:[UIImage imageNamed:@"placeholder.png"]]; 

과 캐시 이미지를 자동으로 단지에서로드를 지원을 캐시 (필요할 경우) 및 자동으로 메모리 경고를 처리합니다.

관련 문제