Skip to content

Instantly share code, notes, and snippets.

@Eluss
Created July 24, 2015 09:45
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 Eluss/0ee3bc08b6805c36c61d to your computer and use it in GitHub Desktop.
Save Eluss/0ee3bc08b6805c36c61d to your computer and use it in GitHub Desktop.
@implementation Task
- (instancetype)initWithName:(NSString *)name {
self = [super init];
if (self) {
self.name = name;
}
return self;
}
- (void)encodeWithCoder:(NSCoder *)coder {
if (self.name != nil) {
[coder encodeObject:self.name forKey:@"name"];
}
}
- (id)initWithCoder:(NSCoder *)coder {
self = [super init];
if (self != nil) {
self.name = [coder decodeObjectForKey:@"name"];
}
return self;
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment