• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Saving a NSMutableArray
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Saving a NSMutableArray


  • Subject: Re: Saving a NSMutableArray
  • From: "Florian G\. Pflug" <email@hidden>
  • Date: Sat, 17 May 2003 02:43:52 +0200

On Fri, May 16, 2003 at 08:09:21PM +0200, Lorenzo wrote:
> let's suppose I have a very large database in an NSMutableArray I did read
> early from the disk.
> Each record is a NSMutableDictionary with 2 keys, Name and Surname.
> If I change one only key, e.g. the Name, of one only record,
> should then I save the whole NSMutableArray with
>
> - (BOOL)writeToFile:(NSString *)path atomically:(BOOL)flag ?
>
> or can I save only the small changement to the existing file?
> If yes, haw can I do?
I think, if the database in your NSMutableDictionary is big enough to make
always saving the whole dictionary to disk a problem, than you should
consider using some sort of database for the whole thing.

I don't mean a full-fleged sql-database, but something like berkely db.
Berkley DB (or one of it's clones) is nearly standard to have an on an unix
system, so I guess OSX includes a version. Look for a library or framework
(or headerfile) call db2 or db3.

A Berkley DB is essentially an on-disk hash, storing arbitrary values to a
key, As far as I remeber, the key has to be a string, though.

Writing a wrapper to make a berkley-db look like a MutableDictionary should
be fairly trivial.

greetings, Florian Pflug
_______________________________________________
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.

  • Follow-Ups:
    • Re: Saving a NSMutableArray
      • From: Chris Ridd <email@hidden>
References: 
 >Saving a NSMutableArray (From: Lorenzo <email@hidden>)

  • Prev by Date: Re: OT: WWDC (DVD's)
  • Next by Date: Re: OT: WWDC
  • Previous by thread: Re: Saving a NSMutableArray
  • Next by thread: Re: Saving a NSMutableArray
  • Index(es):
    • Date
    • Thread