Skip to content

Instantly share code, notes, and snippets.

@nickjshearer
Created April 25, 2013 15:32
Show Gist options
  • Save nickjshearer/5460647 to your computer and use it in GitHub Desktop.
Save nickjshearer/5460647 to your computer and use it in GitHub Desktop.
@implementation Article
- (id)initWithDictionary:(NSDictionary *)dictionary {
self = [self init];
if (self != nil) {
self.title = jsonObject[@"title"];
self.body = jsonObject[@"body"];
self.url = [NSURL URLWithString:jsonObject[@"url"]];
self.dateModified = [self.dateFormatter dateFromString:jsonObject[@"modified"]];
// etc etc etc
}
return self;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment