AFNetworking + Pause/ Reprendre le téléchargement de gros fichiers

J'ai besoin de télécharger de gros .les fichiers zip (jusqu'à 800 MO) avec mon iPad.
Je veux reprendre le télécharger à nouveau si elle est annulée ou si l'application est en arrière-plan.

operation = [[AFHTTPRequestOperation alloc] initWithRequest:request];
operation.outputStream = [NSOutputStream outputStreamToFileAtPath:filePath append:YES];

[operation setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id responseObject){

//unzip the .zip


}failure:^(AFHTTPRequestOperation *operation, NSError *error){

//Handle the error

}];


[operation setDownloadProgressBlock:^(NSInteger bytesWritten, long long totalBytesWritten,long long totalBytesExpectedToWrite) {

//update the progressView

}];

[operation setShouldExecuteAsBackgroundTaskWithExpirationHandler:^{

//What I have to do here?

}];

[operation start];
[operation waitUntilFinished];


-(void)applicationWillResignActive:(UIApplication *)application{

//What I have to do here?

}

Merci pour votre aide.

InformationsquelleAutor L0rdShrek | 2012-08-29