@@ -19,7 +19,7 @@ @interface SDWebImageDownloaderOperation ()
19
19
20
20
@property (assign , nonatomic , getter = isExecuting) BOOL executing;
21
21
@property (assign , nonatomic , getter = isFinished) BOOL finished;
22
- @property (assign , nonatomic ) NSUInteger expectedSize;
22
+ @property (assign , nonatomic ) NSInteger expectedSize;
23
23
@property (strong , nonatomic ) NSMutableData *imageData;
24
24
@property (strong , nonatomic ) NSURLConnection *connection;
25
25
@property (strong , atomic ) NSThread *thread;
@@ -36,7 +36,7 @@ @implementation SDWebImageDownloaderOperation
36
36
BOOL responseFromCached;
37
37
}
38
38
39
- - (id )initWithRequest : (NSURLRequest *)request options : (SDWebImageDownloaderOptions)options progress : (void (^)(NSUInteger , NSUInteger ))progressBlock completed : (void (^)(UIImage *, NSData *, NSError *, BOOL ))completedBlock cancelled : (void (^)())cancelBlock
39
+ - (id )initWithRequest : (NSURLRequest *)request options : (SDWebImageDownloaderOptions)options progress : (void (^)(NSInteger , NSInteger ))progressBlock completed : (void (^)(UIImage *, NSData *, NSError *, BOOL ))completedBlock cancelled : (void (^)())cancelBlock
40
40
{
41
41
if ((self = [super init ]))
42
42
{
@@ -94,7 +94,7 @@ - (void)start
94
94
{
95
95
if (self.progressBlock )
96
96
{
97
- self.progressBlock (0 , - 1 );
97
+ self.progressBlock (0 , NSURLResponseUnknownLength );
98
98
}
99
99
[[NSNotificationCenter defaultCenter ] postNotificationName: SDWebImageDownloadStartNotification object: self ];
100
100
@@ -208,7 +208,7 @@ - (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLRespon
208
208
{
209
209
if (![response respondsToSelector: @selector (statusCode )] || [((NSHTTPURLResponse *)response) statusCode ] < 400 )
210
210
{
211
- NSUInteger expected = response.expectedContentLength > 0 ? (NSUInteger )response.expectedContentLength : 0 ;
211
+ NSInteger expected = response.expectedContentLength > 0 ? (NSInteger )response.expectedContentLength : 0 ;
212
212
self.expectedSize = expected;
213
213
if (self.progressBlock )
214
214
{
@@ -242,7 +242,7 @@ - (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data
242
242
// Thanks to the author @Nyx0uf
243
243
244
244
// Get the total bytes downloaded
245
- const NSUInteger totalSize = self.imageData .length ;
245
+ const NSInteger totalSize = self.imageData .length ;
246
246
247
247
// Update the data source, we must pass ALL the data, not just the new bytes
248
248
CGImageSourceRef imageSource = CGImageSourceCreateIncremental (NULL );
0 commit comments