tags:

views:

289

answers:

1

I'm currently using *.plist files for my iPhone app to store information that is later read into strings as NSArray or NSDictionary equivalents. I will be updating these files periodically and downloading them to the application if a new version is found. I would like to use the <plist version="1.0"> string located in each *.plist file to make these comparisons since it won't interfere with the actual content of the plist file.

My question: is it possible to access this information and use it in the manner I describe, or is this version information describing the version of the *.plist protocol and not the actual file itself? For example, can I change this to: <plist version="1.1"> for a new version of the file, read this version info and update the file if newer? If this is possible, I haven't found a way to extract this information using the iPhone SDK (the comparison and update part will be easy).

+1  A: 

I'm pretty sure you should'nt touch that. It's probably used by apple for future-compability (or future backwards compability, if you prefer). So that if/when they change the syntax of plists, old ones will still work.

Easiest would be to have the first entry contain the version number, or possible as a part of the file name. Or maybe even at a completetley different place, like in a database or as a part of a file structure on the server.

Jonatan Hedborg
Thanks. I was just looking at it again and realized that it's also used as the prefix for the file, ie, the plist file starts with <plist version="1.0"> and ends with </plist>. I'll definitely leave it alone and add a version entry at the top of each plist that I'll just remove before use.
Ricky