From b44c8b5daed501ce7a6724665c85fe6c518cc2c3 Mon Sep 17 00:00:00 2001 From: Jack Date: Tue, 10 Jun 2014 18:45:32 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E6=97=B6=E9=97=B4=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- RefreshControl/XHRefreshControl.m | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/RefreshControl/XHRefreshControl.m b/RefreshControl/XHRefreshControl.m index 155a988..ceaf1d9 100644 --- a/RefreshControl/XHRefreshControl.m +++ b/RefreshControl/XHRefreshControl.m @@ -65,8 +65,13 @@ - (void)startPullDownRefreshing { self.pullDownRefreshing = YES; NSDate *date = [self.delegate lastUpdateTime]; - if (date || [date isKindOfClass:[NSDate class]]) { - self.refreshView.timeLabel.text = [NSString stringWithFormat:@"上次刷新:%@", @"10小时前"]; + if ([date isKindOfClass:[NSDate class]] || date) { + NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; + + [dateFormatter setDateFormat:@"MM-dd HH:mm"]; + + NSString *destDateString = [dateFormatter stringFromDate:date]; + self.refreshView.timeLabel.text = [NSString stringWithFormat:@"上次刷新:%@", destDateString]; } self.refreshState = XHRefreshStatePulling;