0
在我的iOS應用程序中實現從網絡保存視頻。下載視頻時,它會不斷增加內存使用量。我檢查了在xcode中使用配置文件,並看到一些malloc增加每個視頻。 繼續增加內存分配
我不熟悉的輪廓的東西。我已經發布了receivedData NSMUtableData變量。
- (void) connectionDidFinishLoading:(NSURLConnection *)connection {
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectry = [paths objectAtIndex:0];
NSLog(@"Succeeded! Received %d bytes of data",[receivedData length]);
[UIApplication sharedApplication].networkActivityIndicatorVisible = NO;
NSString *filename = [NSString stringWithFormat:(@"video_%@.mp4"),videoURL];
[receivedData writeToFile:[documentsDirectry stringByAppendingPathComponent:filename ] atomically:YES];
receivedData = nil;
[receivedData release];
progress.hidden = YES;
}
應用得到了它的性能。我該如何解決這個問題。