当前位置: 动力学知识库 > 问答 > 编程问答 >

iphone - NSURLConnection plays up

问题描述:

I have an iphone app which has an NSURLConnection downloading a large video file. It takes about 5-10 minutes to download (a little bit of data at a time).

There are some problems though.

If the iPhone is just left on the side to download then the screen turns off and the iPhone locks. This seems to cause the download to stop. (and calls connection:didFailWithError:).

Sometimes as well the download will finish well before it is supposed to. For instance it will download the first 20 seconds of a 3 minute film and then call connectionDidFinishLoading:.

I have no idea why this is happening. If I download a smaller film (say 15seconds) then it works perfectly, I just don't know why it chokes on the larger files, or could it just be my internet connection?

Thanks

Tom

网友答案:

See this stackoverflow answer.You have to mention the timeout interval.

All the best.

分享给朋友:
您可能感兴趣的文章:
随机阅读: