quick question about plist
Can my application download a .plist from a URL and replace the one that I built i开发者_运维知识库n xcode and shipped with the application?
Thanks Leo
No, you can't change anything in your application bundle. You must download you plist file to some folder in application sandbox (documents or caches) and read it from there.
Your possible workflow for reading that plist can be:
- Check if plist file is present at download location. If yes - read it from there
- If it is not present - read plist shipped with your bundle (or copy plist file from bundle to download location and go to step 1 - this way workflow may be a bit more consistent)
You can use an NSURLRequest
to download the .plist file, and then save it the Documents directory in your app's sandbox. Use the NSSearchPathsForDocumentsInDomain
() function (see the Foundation Functions reference for more info) to get the file system path to the Documents directory.
Read for More
精彩评论