• 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
Passing object graphs bycopy (was: DO, bycopy)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Passing object graphs bycopy (was: DO, bycopy)


  • Subject: Passing object graphs bycopy (was: DO, bycopy)
  • From: "Rafael K. Kobylinski" <email@hidden>
  • Date: Thu, 14 Mar 2002 18:56:08 +0100

Hi,

I am trying to pass a (very) simple object graph bycopy in a DO application. The graph consists of just two objects. I have implemented replacementObjectForPortCoder: and NSCoding for both, but the second object is passed as a proxy nevertheless.

My first object receives the replacementObjectForPortCoder: message and returns self, because [encoder isBycopy] returns YES as expected. Then my encodeWithCoder: method is called, where I send the encodeObject: message to my second object. My second object then receives the replacementObjectForPortCoder: message but this time [encoder isBycopy] surprisingly evaluates to NO.

I read the (recently updated) Cocoa documentation on Archiving and DO but could not find anything that would explain why I cannot pass both objects bycopy.

Did I make a mistake or is there something additional that needs to be done here?


At 0:03 Uhr +0200 26.10.2001, John Hvrnkvist wrote:
Look at NSPortCoder and classForPortCoder/replacementObjectForPortCoder.

- (id)replacementObjectForPortCoder:(NSPortCoder *)encoder
{
if ([encoder isBycopy]) return self;
return [super replacementObjectForPortCoder:encoder];
}


--
Rafael K. Kobylinski Email: email@hidden
Institut f|r Informatik Tel. : ++ 49 89 289 22391
Technische Universitdt M|nchen Cell.: ++ 49 177 7 495020
_______________________________________________
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: Passing object graphs bycopy (was: DO, bycopy)
      • From: "Rafael K. Kobylinski" <email@hidden>
  • Prev by Date: Re: Why the name Cocoa?
  • Next by Date: Re: Why the name Cocoa?
  • Previous by thread: Re: How do I cancel beginSheet: before the next run loop?
  • Next by thread: Re: Passing object graphs bycopy (was: DO, bycopy)
  • Index(es):
    • Date
    • Thread