Re: Commandline Tool Help - NSDistantObject and NSConnection
Re: Commandline Tool Help - NSDistantObject and NSConnection
- Subject: Re: Commandline Tool Help - NSDistantObject and NSConnection
- From: "Adam R. Maxwell" <email@hidden>
- Date: Tue, 03 Nov 2009 07:27:09 -0800
On Nov 2, 2009, at 10:04 PM, Jens Alfke wrote:
> This misfeature has confused a lot of people over the years, including me. My solution, once I found out what was going on, was to never send NSURLs over DO — I converted them to NSStrings on the sending side and back to NSURLs on the receiving.
Jens' solution is best, but I've also used a category override to work around this. If NSURL ever implements replacementObjectForPortCoder: in a category, this will break.
@interface NSURL (PortCoderFix) @end
@implementation NSURL (PortCoderFix)
- (id)replacementObjectForPortCoder:(NSPortCoder *)encoder
{
return [encoder isByref] ? (id)[NSDistantObject proxyWithLocal:self connection:[encoder connection]] : self;
}
@end
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
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