• 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 objects in a database
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Archiving objects in a database


  • Subject: Archiving objects in a database
  • From: Keith Renz <email@hidden>
  • Date: Tue, 14 Oct 2003 19:58:25 -0400

In my app, I have several hundred (~200-800) custom objects in a main database (an NSArray). Documents in my app generally move/sort a subset of these objects and then save/open this subset. Once a database is created (monthly), the objects never change their order -- their content may change, but not their order. When I save a document, I don't need to archive the document's objects (since they're references to objects in the main database). All I need to archive is the indexes of the objects in the main database. But, on the other hand, when I archive the main database, I do want to archive the objects.

I'm not sure how to go about doing this. It seems that I might be able to use -replacementObjectForKeyedArchiver: but I only want to do this for objects archived in a document. How would the object being archived know if it's being archived into my database or my document? I'm thinking that I could subclass NSKeyedArchiver, use this archiver for documents only and check the archiver's class in -replacementObjectForKeyedArchiver:. If it's my subclass, replace the object with an index. This seems like a waste because my subclass wouldn't do anything different than the superclass. It's simply using the class as a flag. So, I think I'm missing something.

Thanks,

Keith
_______________________________________________
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: Archiving objects in a database
      • From: Dan Waylonis <email@hidden>
  • Prev by Date: 300 dpi PNG files
  • Next by Date: Re: Reading binary file into NSString
  • Previous by thread: 300 dpi PNG files
  • Next by thread: Re: Archiving objects in a database
  • Index(es):
    • Date
    • Thread