for (int i=0; i<[images count] ;i++) {
[email protected]"http://192.168.0.101/titan/titanimages/";
url=[url stringByAppendingString:[images objectAtIndex:i]];
//NSData *imageData=[[NSData alloc] initWithContentsOfURL:[NSURL URLWithString:url]];
NSData *imageData=[NSData dataWithContentsOfURL:[NSURL URLWithString:url]];
destinationPath=[documentsDirectory stringByAppendingString:@"/modelimages"];
destinationPath=[destinationPath stringByAppendingPathComponent:[images objectAtIndex:i]];
[imageData writeToFile:destinationPath atomically:YES];
value=value+divideValue;
printf("%f\n",value);
[NSThread detachNewThreadSelector:@selector(updateProgressBar)toTarget:self withObject:nil];
}
Ce code présente une fuite de mémoire: il ne libère pas de mémoire de NSdata et après un certain temps, l'utilisation de la mémoire de l'application atteint 61 Mo. Quelqu'un peut-il m'aider à m'en sortir?Memory Leak Copie de données à partir du serveur