2013-03-18 164 views
1

我檢查了一些這方面的答案,但這是特定於我的代碼,我不能得到這個工作。有什麼想法嗎?不兼容的塊指針類型SDWebImage

錯誤開始於

completed:^(UIImage *image, NSError *... 

完整代碼

//Load from URL 
     NSURL *url =[NSURL URLWithString:image.imageURL]; 


     SDWebImageManager *manager = [SDWebImageManager sharedManager]; 

     [manager downloadWithURL:url 
         options:0 
         progress:^(NSUInteger receivedSize, long long expectedSize) 
     { 
      // progression tracking code 
     } 
         completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType) 
     { 
      if (image) 
      { 
       // do something with image 
      } 
     }]; 

回答

3

SDWebImageManager頭中,該方法被聲明爲:

- (id<SDWebImageOperation>)downloadWithURL:(NSURL *)url 
            options:(SDWebImageOptions)options 
            progress:(SDWebImageDownloaderProgressBlock)progressBlock 
           completed:(SDWebImageCompletedWithFinishedBlock)completedBlock; 

SDWebImageCompetedWithFinishedBlock被聲明像這樣:

typedef void(^SDWebImageCompletedWithFinishedBlock)(UIImage *image, NSError *error, SDImageCacheType cacheType, BOOL finished); 

因此,它看起來像你缺少finishedBOOL

+0

也做到了,謝謝! – 2013-03-18 19:16:14