Hi,

I've been beating my head against the monitor for the past 2 hours trying to 
figure this out. I would really appreciate it if someone can give me some 
guidelines.

I have a server - client application, and I need to archive an object so that I 
can send the data back and forth between the client and the server. Here is 
what the archiving methods in the object look like, property1 being a NSString:

- (void)encodeWithCoder:(NSCoder *)coder {
    //  [super encodeWithCoder:coder];
        
    [coder encodeObject:property1 forKey:@"Property1"];
}

- (id)initWithCoder:(NSCoder *)coder {
    //self = [super initWithCoder:coder];
    self = [super init];

    property1 = [[coder decodeObjectForKey:@"Property1"] retain];
    return self;
}

My problem is that I can archive and unarchive this object just fine on the 
client, but once I send the data over the network to the server, attempting to 
unarchive the object then results in an exception being thrown. I tried to 
compare the byte and length of the data before and after sending it over the 
network, and they appears to be identical. I tried to send a simple archived 
NSArray, and it works fine. So I must've missed something really important in 
my code.

I would appreciate any help.

Thanks,

Tony S. Wu
tonyswu....@gmail.com




_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to