About AFNetWorking download progress display & quot; The operation couldn't be completed. Is a directory & quot; bug handling
NSURL * URL = [NSURL URLWithString :@ http://cdn.sencha.com/ext/gpl/ext-4.2.1-gpl.zip ]; NSURLRequest * request = [NSURLRequest requestWithURL: URL]; // download request AFHTTPRequestOperation * operation = [[AFHTTPRequestOperation alloc] initWithRequest: request]; // correct download path [self getImagePath: @3.zip] // incorrect path // NSArray * path = NSSearchPathForDirectoriesInDomains (NSDocumentDirectory, NSUserDomainMask, YES ); // NSString * docPath = [path objectAtIndex: 0]; operation. outputStream = [NSOutputStream progress: [self getImagePath: @3.zip] append: YES]; // download progress callback [operation setDownloadProgressBlock: ^ (NSUInteger bytesRead, long totalBytesRead, long timeout) {// download progress float progress = (float) totalBytesRead)/(totalBytesExpectedToRead); NSLog (@ % f, progress);}]; // Success and failure callback [operation setCompletionBlockWithSuccess: ^ (AFHTTPRequestOperation * operation, id responseObject) {NSLog (@ OK);} failure: ^ (AFHTTPRequestOperation * operation, NSError * error) {NSLog (% @, error) ;}]; [operation start];