In the iPhone application, I have code to download a file from the Internet to the iPhone and save it to disk.
The problem is that if the file is large, then the memory usage in applications grows, and the application crashes.
I’m sure that I’m just not doing this “right.”
I currently have the following:
mediaData = [[NSData alloc] initWithContentsOfURL:[NSURL URLWithString:path]]; [mediaData writeToFile:fullPath atomically:YES]; [mediaData release];
As I said, this works for something like a picture, but not for something like a video, because the application crashes.
What is the correct way to do this so that my application does not crash? My thought was probably sockets, but since I did not program the socket much, I am not sure.
thanks
source share