Using more concise initializer for AFImageRequestOperationCallback
This commit is contained in:
parent
63dc2a05ed
commit
83f0ce3c26
1 changed files with 2 additions and 4 deletions
|
|
@ -54,9 +54,7 @@ static NSMutableSet *_cachedRequests = nil;
|
||||||
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLCacheStorageAllowed timeoutInterval:30.0];
|
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLCacheStorageAllowed timeoutInterval:30.0];
|
||||||
[request setHTTPShouldHandleCookies:NO];
|
[request setHTTPShouldHandleCookies:NO];
|
||||||
|
|
||||||
AFImageRequestOperationCallback *callback = [AFImageRequestOperationCallback callbackWithSuccess:block];
|
AFImageRequestOperationCallback *callback = [AFImageRequestOperationCallback callbackWithSuccess:block imageSize:imageSize options:options];
|
||||||
callback.options = options;
|
|
||||||
callback.imageSize = imageSize;
|
|
||||||
AFImageRequestOperation *operation = [[[AFImageRequestOperation alloc] initWithRequest:request callback:callback] autorelease];
|
AFImageRequestOperation *operation = [[[AFImageRequestOperation alloc] initWithRequest:request callback:callback] autorelease];
|
||||||
|
|
||||||
NSCachedURLResponse *cachedResponse = [[[[AFURLCache sharedURLCache] cachedResponseForRequest:request] retain] autorelease];
|
NSCachedURLResponse *cachedResponse = [[[[AFURLCache sharedURLCache] cachedResponseForRequest:request] retain] autorelease];
|
||||||
|
|
@ -91,7 +89,7 @@ static NSMutableSet *_cachedRequests = nil;
|
||||||
if (!([operation isExecuting] || [operation isCancelled])) {
|
if (!([operation isExecuting] || [operation isCancelled])) {
|
||||||
[operation cancel];
|
[operation cancel];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue