0
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];
}
이 코드는 메모리 누수가 있습니다. NSdata의 메모리를 해제하지 않으며 얼마 후에 응용 프로그램의 메모리 사용량이 61MB에 도달합니다. 아무도 내가이 일에서 빠져 나올 수있게 도와 줄 수 있습니까?메모리 누수 서버에서 데이터 복사