• 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: Archiving objects without their owner[1]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Archiving objects without their owner[1]


  • Subject: Re: Archiving objects without their owner[1]
  • From: Andre Lipinski <email@hidden>
  • Date: Tue, 18 Dec 2001 23:30:53 -0500

On Tuesday, December 18, 2001, at 04:19 PM, Dan Bernstein wrote:

What I'm trying to do is basically what (I think) AppKit does with nib files:

I want to archive an object graph in which multiple objects point to some "owner" object. I don't want the owner (and the graph rooted at it) to be archived. When unarchiving, I want everything that pointed to the "owner"
to point to an object I supply.

I guess I should use [NSArchiver replaceObject:withObject:] to archive some "dummy" "placeholder" instead of the owner when archiving. It's just that it isn't clear when I'm supposed to do when unarchiving, in particular - what should be the first argument to [NSUnarchiver replaceObject:withObject:].

Hi Dan,

Consider using [NSNull null] as the dummy argument, all instances point to the same thing and make it easy to use, unless you want to replace multiple things with multiple things which brings us to unarchiving!

If you'd like to just handle one owner per archive, it's real easy, use replaceObject:[NSNull null] withObject: then decode the root object.

With multiple replaced things it's more tricky if you'd like some tips, please email.

Andre.


  • Follow-Ups:
    • Re: Archiving objects without their owner[1]
      • From: Dan Bernstein <email@hidden>
References: 
 >Archiving objects without their owner[1] (From: Dan Bernstein <email@hidden>)

  • Prev by Date: Sketch's Save a Copy As... Items
  • Next by Date: division with long long
  • Previous by thread: Archiving objects without their owner[1]
  • Next by thread: Re: Archiving objects without their owner[1]
  • Index(es):
    • Date
    • Thread