Re: Storing structured data in file - any easy way?
Re: Storing structured data in file - any easy way?
- Subject: Re: Storing structured data in file - any easy way?
- From: Jules Colding <email@hidden>
- Date: Fri, 11 Jul 2008 22:39:44 +0200
Hi Jens,
On 10/07/2008, at 22.50, Jens Alfke wrote:
On 10 Jul '08, at 11:29 AM, Jules Colding wrote:
Assume that I want to store the set {"HI", "HELLO"}. At one point I
want to be able to use "HI" as key and get "HELLO". At another
point I want to use "HELLO" as key and get "HI".
There are several trivial ways to do this. I could use two
NSDictionary's and use the NSCopying protocol to store both.
Unfortunately that will make at least one, possibly both,
dictionaries present in memory at query time.
You mean NSCoding, not NSCopying, right?
oops, yes.
The overhead for two dictionaries as opposed to one shouldn't be too
high. Hash-table overhead is something like 4*sizeof(void*) bytes
times the number of keys. It's the strings themselves that will take
up most of the memory, and those are shared between dictionaries.
On the other hand, if the overhead of even one copy of the data in
memory is too high, archiving isn't the way to go.
The best solution seems to be some kind of lightweight database...
Is there any cocoa framework that implements a simple database or
should I manually seek through a file?
The typical solution for this is SQLite,
Exactly what I've decided.
Thanks,
jules
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden