Skip to content

Instantly share code, notes, and snippets.

@Rich86man
Created September 27, 2012 22:40
Show Gist options
  • Save Rich86man/3796881 to your computer and use it in GitHub Desktop.
Save Rich86man/3796881 to your computer and use it in GitHub Desktop.
- ( void ) updateWithDictionary: ( NSDictionary * ) dict {
if( !dict ) { return; }
NSString * dateString = [ dict objectForKey: @"created_at" ];
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc]init];
[ dateFormatter setDateFormat:@"yyyy'-'MM'-'dd'T'HH':'mm':'ss'Z'"];
NSDate* date = [dateFormatter dateFromString:dateString];
self.createdAt = date;
self.serverId = [ dict objectForKey: @"id" ];
self.favorite = [ dict objectForKey: @"favorite" ];
self.mediumUrl = [ dict objectForKey: @"medium_url" ];
self.largeUrl = [ dict objectForKey: @"large_url" ];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment