tags:

views:

13

answers:

1

I need to store various types of data and update it from different parts of my application at different times. I was under the impression I could use NSKeyedArchiver to do this and just update parts of the data using the appropriate key when necessary...much like a database. It seems that NSKeyedArchiver overwrites the entire file every time you archive.

Am I correct in that NSKeyedArchiver overwrites the entire file and if so, is there a strategy you would suggest for dealing with this (other than using SQLLite or CoreData..I'll probably have to upgrade to this for the next release). I can separate out the data into different files but that seems like a lot of work.

A: 

Yes, NSKeyedArchiver replaces the data on disk with its data. To do what you want will probably take SOME sort of database solution, though not necessarily SQLite. How large is your data set? Is re-writing the whole thing that slow?

Ben Gottlieb
Thanks Ben. The data set could become quite large as it is storing statistical data so I wil have to replace the storage mechanism with a DB at some point. Not sure how long it would take to rewrite because I am not up to speed on using a DB solution in the iOS platform.
JMH