views:

827

answers:

2

HI,

i want to store some data in plist file. my question is if i change data in plist file do i have to recompile my application ??

A: 

You don't have to, but if copying the plist to its proper location is part of your build process (ie, if it's going in a Resources folder or something), then it's probably easiest to just recompile so that the modified version gets copied. The compiler is smart. It's not going to recompile things that haven't changed since the last compilation, so if all you're doing is editing the plist and recompiling, it should go very quickly.

Other than that you're welcome to just pop it open in Property List Editor and modify it in-place.

Dave DeLong
A: 

I'm not quite sure I understand your question. Here are some things to think about:

  1. If you haven't yet stored the data in the plist file, and your app needs to read it in, then your app needs to know how to read (and maybe write) the plist file, and the format of the data within it. For that, you'd need to recompile your app.

  2. If you have an app already, and you want to go inside the "package" and modify a plist file in there, then you will be breaking the app since the app is digitally signed and will not run if the signature is invalid. To make a valid signature, you need to rebuild your app using Xcode or some other signing utility (i don't know of any). This might not mean that your app has to recompile, but it does have to "rebuild".

  3. If you plan on modifying this plist file after the app is built, whether programmatically by your app or otherwise, then your app needs to be getting this plist file from someplace outside of your app bundle, to get around the signature issue. There, it can be modified or read without invalidating your app.

  4. If you want a way to distribute this plist file with the app, then put it in your resource folder in Xcode. In your app, check if you can find that file in your Preferences or Documents folder, and if not, then go ahead and copy the file from your app bundle into the Prefs or Documents folder. From then on, then use that copy.

mahboudz