tags:

views:

234

answers:

2

Hi All,

I want to download a large video file to Iphone in my app. I used NSURLConnection and saving the file to disk once it completly downloads the video.

As my video is large, it is crashing in middle.

Is there anyway like directly saving the file to disk without keeping it in memory.

Thanks,

+2  A: 

NSURLConnection calls a method you can write called

- (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data;

which receives the data in smaller chunks. You can save that data to a file as you receive it.

Here is Apple's doc on NSURLConnection, which gives more details.

Also note that you risk app-store rejection if you're retrieving a large amount of data via Edge or 3G, although using wireless is safe: app rejected reason.

Tyler
A: 

convert to any format for iPhone: http://www.asharer.com/convert-video-to-video-for-any-media-player.html

Guggenheim