Search code examples
iphonedocuments

Retrieving updated files from server to replace files on documents folder of an iPhone


Im new to iPhone programming and wanted to see how people have solved this problem:

Ive created my app which will ship with certain pLists and .png files in the main bundle. However, what I want to do is when the app starts up, Id like it to check my server to see if there are updated versions of the files in the documents folder available. If so Id like the app to download those files.

I was wondering if someone can point me to some resources on how to do this? Ive searched online but haven't come up with good hits.

Whats the google key-word for searching this topic anyways?

Thanks a lot


Solution

  • you can use NSUrlRequest to download the files, to move them to the correct place you can use NSFileManager, if you look at the apple docs for both these classes there should be sample code explaining how to copy/save a file from NSData, and also how to download it.