开发者

Download in background in iPhone

Is it possible to download a开发者_开发技巧 file while the app is in background in iPhone 4?


Yes, it is.

It's supported in ASIHTTPRequest as of v1.8:

http://allseeing-i.com/ASIHTTPRequest/How-to-use#background_downloads_ios

(There was also an experimental branch of v1.7 with it at http://github.com/pokeb/asi-http-request/commits/backgroundtask but this appears not to exist anymore.)

It's also supported in AFNetworking, see Does AFNetworking have backgrounding support?


Under iOS 4.x, you can use request some background time using UIApplication beginBackgroundTaskWithExpirationHandler: and perhaps continue a file download for a limited period of time.

See Apple's document on "multitasking" background execution for details.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜