• 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
encoding vended objects
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

encoding vended objects


  • Subject: encoding vended objects
  • From: "Brian Chin" <email@hidden>
  • Date: Tue, 28 Aug 2007 23:47:00 -0400

Hi all,

I'm using cocoa distributed objects to send a custom object to a client app.
The custom class is simple. IIt contains two NSNumber fields as well as a
NSString. I've added the following methods to encode this custom object:

- (void)encodeWithCoder:(NSCoder *)encoder
{
  [encoder encodeObject:distance forKey:@"distance"];
  [encoder encodeObject:duration forKey:@"time"];
  [encoder encodeObject:dateFor forKey:@"name"];
}

- (id)initWithCoder:(NSCoder *)decoder
{
  distance = [[decoder decodeObjectForKey:@"distance"] retain];
  duration = [[decoder decodeObjectForKey:@"time"] retain];
  dateFor = [[decoder decodeObjectForKey:@"name"] retain];
  return self;
}

This seems simple enough. However, my app crashes when trying to send this
object through a NSPortCoder.

I have been able to send NSData objects over this connection, but not my
custom objec t.

Is there something I'm missing about tthe structure of my custom classes
that could be causing trouble here?

How might I go about debugging this?

thanks in advance

brian
_______________________________________________

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:
    • Re: encoding vended objects
      • From: Jacob Engstrand <email@hidden>
    • Re: encoding vended objects
      • From: "Adam R. Maxwell" <email@hidden>
  • Prev by Date: Re: seemingly simple Core Data fetch question
  • Next by Date: Re: NSXMLDocument freezes UI
  • Previous by thread: Re: seemingly simple Core Data fetch question
  • Next by thread: Re: encoding vended objects
  • Index(es):
    • Date
    • Thread