如何在iPhone上使用Objective C下载大文件 [英] How to download large files using objective c on iphone

查看:54
本文介绍了如何在iPhone上使用Objective C下载大文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我编写了一个可通过http从服务器下载文件的应用程序.使用我的应用程序时,用户将始终处于WLAN上.它可以下载< 10MB的文件,没有任何问题,但是该应用程序仅挂起较大的文件. 是否有下载大型文件的最佳实践方法,还是我需要实现某种形式的分块?

任何代码示例将不胜感激. 非常感谢 托尼

解决方案

我建议使用 ASIHTTPRequest.

它可以在后台下载文件而不会阻止您的应用程序,甚至可以挂接到进度条或类似的栏中. 如何使用" 提供了许多示例和示例代码. /p>

I ve written an app that downloads files from a sever via http. The users will always be on WLAN when using my app. It downloads files of <10MB without any issues but the application just hangs for larger files. Is there a best practice way to download large files or do i need to implement some form of chunking?

Any code samples would be much appreciated. Many thanks Tony

解决方案

I would recommend using ASIHTTPRequest library.

It can download files on the background without blocking your app, and can even hook into into a progress bar or something like that. The "How to use it" provides lots of examples and sample code.

这篇关于如何在iPhone上使用Objective C下载大文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆