encoding vended objects
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