mwaterfall / MWPhotoBrowser

A simple iOS photo and video browser with grid view, captions and selections.
MIT License
8.75k stars 2.71k forks source link

SDWebImage error #592

Open buoooou opened 7 years ago

buoooou commented 7 years ago

/MWPhotoBrowser/MWPhotoBrowser/Classes/MWPhoto.m:162:63: Incompatible block pointer types sending 'void (^)(NSUInteger, long long)' to parameter of type 'SDWebImageDownloaderProgressBlock' (aka 'void (^)(NSInteger, NSInteger)')

ZhangComer commented 7 years ago

solved? how?

buoooou commented 7 years ago

my project imports MWPhotoBrowser,has error.solved by changing block pointer types "void (^)(NSUInteger, long long)" to "void (^)(NSInteger, NSInteger)".

buoooou commented 7 years ago

my english is poor ,hope u could understood what i say

ZhangComer commented 7 years ago

Thank you. Totally understand.

younatics commented 6 years ago

See MediaBrowser I made this library to Swift3 using latest SDWebImage

kb100824 commented 6 years ago

@zhangkuo921112 I Sove it,

typedef void(^SDWebImageDownloaderProgressBlock)(NSInteger receivedSize, NSInteger expectedSize);

#pragma mark - progress block参数类型不对导致报错
                _webImageOperation = [manager downloadWithURL:_photoURL
                                                      options:0
                                                     progress:^(NSInteger receivedSize,NSInteger expectedSize) {
                                                         if (expectedSize > 0) {
                                                             float progress = receivedSize / (float)expectedSize;
                                                             NSDictionary* dict = [NSDictionary dictionaryWithObjectsAndKeys:
                                                                                   [NSNumber numberWithFloat:progress], @"progress",
                                                                                   self, @"photo", nil];
                                                             [[NSNotificationCenter defaultCenter] postNotificationName:MWPHOTO_PROGRESS_NOTIFICATION object:dict];
                                                         }
                                                     }
                                                    completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, BOOL finished) {
                                                        if (error) {
                                                            MWLog(@"SDWebImage failed to download image: %@", error);
                                                        }
                                                        _webImageOperation = nil;
                                                        self.underlyingImage = image;
                                                        [self decompressImageAndFinishLoading];
                                                    }];