Using more concise initializer for AFImageRequestOperationCallback

This commit is contained in:
Mattt Thompson 2011-06-01 10:37:43 -05:00
parent 63dc2a05ed
commit 83f0ce3c26

View file

@ -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