简体   繁体   中英

iPhone SDK: Downloading large files from a server into the app's documents

I am building an app that plays multiple video files, But I would like to know How do you download a video file (100mb - 300mb) from a server into the application's documents so it can later be locally referred to in code? The reason I want this type of a set up in my app is that I don't want the app binary to be made unnecessarily large due to including videos some users may not want. Also does this violate any of apple's terms? Also would it be simple to implement a progress view with this kind of set up and if so how? Any help is appreciated.

You can't download anything into the app bundle - it's read only. You'll need to download it to the documents folder. Make sure you only download huge files over wi-fi, or your app might be rejected for abusing the cellular network. As for the method, just use NSURLConnection .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM