Created
September 27, 2012 22:40
-
-
Save Rich86man/3796881 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
- ( 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