Skip to content

Instantly share code, notes, and snippets.

@dennda
Created November 12, 2011 01:28
Show Gist options
  • Save dennda/1359862 to your computer and use it in GitHub Desktop.
Save dennda/1359862 to your computer and use it in GitHub Desktop.
#define MESSAGE_KEY @"message_key"
#define ARGUMENTS_KEY @"arguments_key"
#define RESPONSE_KEY @"response_key"
@implementation ...
@synthesize message=_message, arguments=_arguments, response=_response, client;
- (id)initWithCoder:(NSCoder *)aDecoder {
self = [super init];
_message = [aDecoder decodeObjectForKey:MESSAGE_KEY];
_arguments = [aDecoder decodeObjectForKey:ARGUMENTS_KEY];
_response = [aDecoder decodeObjectForKey:RESPONSE_KEY];
self.client = nil;
return self;
}
- (void)encodeWithCoder:(NSCoder *)aCoder {
[aCoder encodeObject:self.message forKey:MESSAGE_KEY];
[aCoder encodeObject:self.arguments forKey:ARGUMENTS_KEY];
[aCoder encodeObject:self.response forKey:RESPONSE_KEY];
}
...
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment