I would like to upload pictures, probably ranging from a few hundred to 1000, originally using AFNetwoking methods, but there is a drawback, it reads all image data one time, then memory is up,for example:
NSOperationQueue *operationQueue = [[NSOperationQueue alloc]init];
[operationQueue setMaxConcurrentOperationCount:1];
for (NSURL *fileURL in filesToUpload) {
NSURLRequest *request = [[AFHTTPRequestSerializer serializer] multipartFormRequestWithMethod:@"POST"
URLString:@"http://example.com/upload" parameters:nil
constructingBodyWithBlock:^(id<AFMultipartFormData> formData) {
[formData appendPartWithFileURL:fileURL name:@"images[]" error:nil];
}];
AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:request];
[operationQueue addOperation:operation];
}
this will read all pictures's data before upload, how can i create a queue reduced memory consumption