• 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
[Distant Objects] Problem passing custom objects bycopy
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Distant Objects] Problem passing custom objects bycopy


  • Subject: [Distant Objects] Problem passing custom objects bycopy
  • From: Oleg Krupnov <email@hidden>
  • Date: Mon, 18 Oct 2010 18:46:58 +0300

Hi,

I have a server and a client processes running on the same machine.
Per client request, the server does some job and returns the result to
the client in form of some MyObject.

This is the interface vended by the server:

- (out bycopy MyObject*)doSomeJob;

Despite bycopy, I see in debugger that instead of a copy, a proxy is returned.

Allright, I've read in this list that in order to make work, I also
need to override -replacementObjectForPortCoder: and I did this:

// in MyObject
- (id)replacementObjectForPortCoder:(NSPortCoder*)encoder
{
	if ([encoder isBycopy])
	{
	         NSLog(@"replace by copy!!!")
		return self;
	}
	return [super replacementObjectForPortCoder:encoder];
}

In this case, I see the "replace by copy!!!" string in the console,
but then the server process seems to hang and become unresponsive.
-[MyObject encodeWithCoder:] does not get called.

What am I doing wrong?

Thanks!
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • [SOLVED] Re: [Distant Objects] Problem passing custom objects bycopy
      • From: Oleg Krupnov <email@hidden>
  • Prev by Date: Re: NSSavePanel does replace / in the filename with a :
  • Next by Date: Re: NSDictionary allValues not mutable
  • Previous by thread: Re: CMYK Text of Photoshop Layer rendered incorrectly
  • Next by thread: [SOLVED] Re: [Distant Objects] Problem passing custom objects bycopy
  • Index(es):
    • Date
    • Thread