-
-
Save nebiros/4a46ace6d762e886a9fb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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