Re: more than one plist in a file.
Re: more than one plist in a file.
- Subject: Re: more than one plist in a file.
- From: Paul Thomas <email@hidden>
- Date: Thu, 1 Dec 2005 11:17:33 +0000
On 1 Dec 2005, at 11:04, Keith Wilson wrote:
Maybe I don't get it but why not:
NSFileHandle *handle = [NSFileHandle handleForUpdatingAtPath:path];
[handle seekToEndOfFile];
write the data
or maybe use FILE *, fopen, fseek, and SEEK_END
This is the scheme I already have, but to later read the data back in
requires writing a codec. Even though this is simple, it's a little
tedious and very error prone. If I use field delimiters, I have to
escape them in strings and binary data.
The cocoa environment already has code to reliably store and retrieve
strings, dates and binary data in base64. It's pointless to waste
development and testing time on a new scheme. The trouble is that the
persistence mechanisms seem to store/retrieve an entire graph at a
time. Even with CoreData it looks like this is going on underneath.
Paul.
On 01/12/2005, at 9:15 PM, Paul Thomas wrote:
On 30 Nov 2005, at 20:46, Markus Hitter wrote:
Am 30.11.2005 um 20:56 schrieb Paul Thomas:
I have an application that is logging events (date + string +
attributed string) to a file and I want to be able to read in
the file when I restart the app. I can't use a straight forward
plist (array of dictionary of {date,string,data}) because the
files can get large and I don't want to rewrite the entire file
to append a single event.
Sounds a lot like you want to use CoreData. Fire up a new project
from the CoreData template in Xcode, then look at the already
inserted code to see how to modify the storage place.
I can't see how that solves my appending problem. Although there's
a lot to take in (never looked at CoreData before - thanks for
bringing it to my attention) it looks like it manages the object
graph and then syncs it to a file on demand.
I'm happy enough with the basic plist functionality - but I only
want to append items to a file.
Cheers,
Paul.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden