Skip to content

Instantly share code, notes, and snippets.

@nebiros
Created February 9, 2015 15:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nebiros/4a46ace6d762e886a9fb to your computer and use it in GitHub Desktop.
Save nebiros/4a46ace6d762e886a9fb to your computer and use it in GitHub Desktop.
#import "Person.h"
@implementation Person
@synthesize name = _name;
@synthesize address = _address;
@synthesize phone = _phone;
- (id)initWithCoder:(NSCoder *)aDecoder
{
if (self = [super init]) {
self.name = [aDecoder decodeObjectForKey:@"name"];
self.address = [aDecoder decodeObjectForKey:@"address"];
self.phone = [aDecoder decodeObjectForKey:@"phone"];
}
return self;
}
- (void)encodeWithCoder:(NSCoder *)aCoder
{
[aCoder encodeObject:self.name forKey:@"name"];
[aCoder encodeObject:self.address forKey:@"address"];
[aCoder encodeObject:self.phone forKey:@"phone"];
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment