CB-6059 iOS: Stop FileTransfer.download doing IO on the UI thread.

This commit is contained in:
Jan Pittner
2014-02-19 10:56:27 -05:00
committed by Andrew Grieve
parent a588236cbd
commit 49b4774e7e
2 changed files with 9 additions and 2 deletions
+8 -2
View File
@@ -412,13 +412,19 @@ static CFIndex WriteDataToStream(NSData* data, CFWriteStreamRef stream)
[delegate cancelTransfer:delegate.connection];
}];
delegate.connection = [NSURLConnection connectionWithRequest:req delegate:delegate];
delegate.connection = [[NSURLConnection alloc] initWithRequest:req delegate:delegate startImmediately:NO];
if (self.queue == nil) {
self.queue = [[NSOperationQueue alloc] init];
}
[delegate.connection setDelegateQueue:self.queue];
if (activeTransfers == nil) {
activeTransfers = [[NSMutableDictionary alloc] init];
}
[activeTransfers setObject:delegate forKey:delegate.objectId];
[delegate.connection start];
}
- (NSMutableDictionary*)createFileTransferError:(int)code AndSource:(NSString*)source AndTarget:(NSString*)target