• 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: Commandline Tool Help - NSDistantObject and NSConnection
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >Commandline Tool Help - NSDistantObject and NSConnection (From: aaron smith <email@hidden>)
 >Re: Commandline Tool Help - NSDistantObject and NSConnection (From: aaron smith <email@hidden>)
 >Re: Commandline Tool Help - NSDistantObject and NSConnection (From: Jens Alfke <email@hidden>)

  • Prev by Date: Re: Odd behavior of [NSDateFormatter dateFromString] with short years?
  • Next by Date: priming the NSBeep pump?
  • Previous by thread: Re: Commandline Tool Help - NSDistantObject and NSConnection
  • Next by thread: Update an NSMenu / NSMenuItem while it's being displayed on key down?
  • Index(es):
    • Date
    • Thread