iphone - How do I append a new item to a plist? -
In my iPhone app, I have two plugin files to store "themes" are the same readable file Includes the default theme, and includes custom themes that the user has created. I am using plist files because it is very easy for me to read from plist and create new theme objects.
My plist dictionary has an array of objects.
Is there any easier way to attach a new dictionary object to my Plast File? Or do I need to read the file in memory, add new dictionary object, and write it back to the file system?
Thank you!
With cocoa, you should read the file in memory, attach the new dictionary object and file it on the file system Must have to write back. If you use XML Plist, you can easily parse it and write file incrementally, but it will be big enough, so it is unlikely to be worth it.
If writing again is taking too long, you should check to use a database instead (perhaps through core data) until the file is large, I suspect that this iPhone There will also be an issue with the memory capacity and flash speed.
Comments
Post a Comment