Skip to content

Instantly share code, notes, and snippets.

@0xjmp
Created February 14, 2013 19:44
Show Gist options
  • Save 0xjmp/4955725 to your computer and use it in GitHub Desktop.
Save 0xjmp/4955725 to your computer and use it in GitHub Desktop.
- (void)setEntry:(NSDictionary *)entry
{
[self willChangeValueForKey:@"entry"];
_entry = entry;
[self didChangeValueForKey:@"entry"];
TTUser *user = [[TTUser alloc] init];
user.userName = entry[@"user"];
self.chatLabel.text = user.userName;
static TTTTimeIntervalFormatter *timeFormatter = nil;
if (timeFormatter == nil) {
timeFormatter = [[TTTTimeIntervalFormatter alloc] init];
}
NSString *timeAgo = [timeFormatter stringForTimeIntervalFromDate:[NSDate date] toDate:entry[@"timestamp"]];
self.contentLabel.text = entry[@"text"];
self.timeLabel.text = timeAgo;
[self.profileImage setImageWithURL:[NSURL URLWithString:user.profileImageURL]];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment