...
|
...
|
@@ -16,12 +16,18 @@ NSString *const SDWebImageDownloadStopNotification = @"SDWebImageDownloadStopNot |
|
|
@end
|
|
|
|
|
|
@implementation SDWebImageDownloader
|
|
|
@synthesize url, delegate, connection, imageData;
|
|
|
@synthesize url, delegate, connection, imageData, userInfo;
|
|
|
|
|
|
#pragma mark Public Methods
|
|
|
|
|
|
+ (id)downloaderWithURL:(NSURL *)url delegate:(id<SDWebImageDownloaderDelegate>)delegate
|
|
|
{
|
|
|
return [[self class] downloaderWithURL:url delegate:delegate userInfo:nil];
|
|
|
}
|
|
|
|
|
|
+ (id)downloaderWithURL:(NSURL *)url delegate:(id<SDWebImageDownloaderDelegate>)delegate userInfo:(id)userInfo
|
|
|
{
|
|
|
|
|
|
// Bind SDNetworkActivityIndicator if available (download it here: http://github.com/rs/SDNetworkActivityIndicator )
|
|
|
// To use it, just add #import "SDNetworkActivityIndicator.h" in addition to the SDWebImage import
|
|
|
if (NSClassFromString(@"SDNetworkActivityIndicator"))
|
...
|
...
|
@@ -38,6 +44,7 @@ NSString *const SDWebImageDownloadStopNotification = @"SDWebImageDownloadStopNot |
|
|
SDWebImageDownloader *downloader = [[[SDWebImageDownloader alloc] init] autorelease];
|
|
|
downloader.url = url;
|
|
|
downloader.delegate = delegate;
|
|
|
downloader.userInfo = userInfo;
|
|
|
[downloader performSelectorOnMainThread:@selector(start) withObject:nil waitUntilDone:YES];
|
|
|
return downloader;
|
|
|
}
|
...
|
...
|
@@ -129,6 +136,7 @@ NSString *const SDWebImageDownloadStopNotification = @"SDWebImageDownloadStopNot |
|
|
[url release], url = nil;
|
|
|
[connection release], connection = nil;
|
|
|
[imageData release], imageData = nil;
|
|
|
[userInfo release], userInfo = nil;
|
|
|
[super dealloc];
|
|
|
}
|
|
|
|
...
|
...
|
|