Writing an NSArray to disk
Writing an NSArray to disk
- Subject: Writing an NSArray to disk
- From: Stephen Colebrook <email@hidden>
- Date: Sun, 16 Nov 2003 01:42:56 -0500
I'm trying to find a better way to write an NSArray to disk than what
I'm currently doing.
Currently, when it comes time to save the array, I use NSArchiver as
follows
[NSArchiver archiveRootObject:anArray toFile:dbFileName];
This will work well for a while, but once the database this array
contains grows, it will be very inefficient. What I'm trying to learn
how to do is be able to save the array when one of it's elements is
altered, a new element added or an existing one removed without having
to re-write the entire array. The method above (if I understand it
correctly) re-writes the whole file. If there was some way of saying
the object at index 4326 needs to be written to disk or something like
that, that would be ideal.
From the little I've been able to learn so far, NSFileHandle seems like
the way to go but I don't know anything about network communications
and most of the docs seem to have that as assumed knowledge so to me,
it is a little confusing.
Am I looking in the right place? Does anyone know of some sample code
somewhere that does what I'm trying to achieve above?
Any suggestions greatly appreciated.
Regards,
Stephen Colebrook
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.