• 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
Archiving *lots* of instances to disk
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Archiving *lots* of instances to disk


  • Subject: Archiving *lots* of instances to disk
  • From: "Kiel Gillard" <email@hidden>
  • Date: Wed, 26 Jan 2005 03:58:42 -0700

Hey guys,

I'd like to know what you guys think I could do about my situation here: I have 2 mutable dictionaries and 1 mutable array which i need to save to disk, so users can restore these instances the next time they start up my program.

Each collection contains instances/objects of custom classes I've made, and each object contains one or many arrays, dictionaries and multiple strings/numbers/attributed strings.

I currently use +[NSKeyedArchiver archiveRootObject: toFile:] to archive a root object which contains two dictionaries with 30 keys and values and 2 objects in the mutable array. This takes about .25 of a second to save everything to one file. Realistically, I'm looking at many times more objects being used - 500 odd in one dictionary and about 1500 in another.

I've thought of the following options I could take to work around the delay:
1) Breaking the file into a file for each collection - but it will still take an unacceptable amount of time.

2) Calling the save method in a thread - is this a good idea? I'll obviously have to use NSLocks to prevent the data changing on the thread.

3) In a thread, saving the 3 different collections independently, depending on which one was changed.

Is there any other options I could use?

Thanks guys!

Kiel :-)

 _______________________________________________
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

  • Follow-Ups:
    • Re: Archiving *lots* of instances to disk
      • From: Jonathan Jackel <email@hidden>
  • Prev by Date: Saving *lots* of instances to disk
  • Next by Date: Re: Archiving *lots* of instances to disk
  • Previous by thread: Re: Saving *lots* of instances to disk
  • Next by thread: Re: Archiving *lots* of instances to disk
  • Index(es):
    • Date
    • Thread