mirror of
https://github.com/apache/cordova-plugin-file-transfer.git
synced 2026-04-28 00:02:49 +08:00
CB-6059 iOS: Stop FileTransfer.download doing IO on the UI thread.
This commit is contained in:
committed by
Andrew Grieve
parent
a588236cbd
commit
49b4774e7e
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user