I’m looking at using a plist to hold some data for my iPhone Application, as the data is small and does not require any filtering / sorting etc the plist seems like the easiest option for me.
Currently I am downloading the plist from the web server each time the app is launched however I would like to only download the plist if it is newer than the locally stored plist file.
Current I thinking of doing the following but was wondering if there is a better way to do this.
App Launch
Is Internet Available
remote_Version = Download MY_SERVER_URL\Version.txt
If local_version < remote_version
file = Download MY_SERVER_URL\data.plist
write plist to disk
end if
end if
Thanks Aaron
If you have the ability to change the serving of the file from the web server, I’d recommend you take a look at the HTTP status codes. Specifically, your web server would ideally return a 304 Not Modified if the file has not been updated. This removes the need to first check a version file. To do this correctly, you could pass the version of the last file downloaded and saved with the request.