- (void)viewDidLoad {
[superviewDidLoad];
UIRefreshControl*refreshControl = [[UIRefreshControlalloc]init];
self.refreshControl= refreshControl;
[self.refreshControladdTarget:selfaction:@selector(refresh:)forControlEvents:UIControlEventValueChanged];
}
-(void)refresh:(UIRefreshControl*)sender {
NSLog(@"已經(jīng)開(kāi)始刷新");
//刷新獲取的數(shù)據(jù)
NSString*refreshResult =@"趙六";
[selfperformSelector:@selector(refreshOver:)withObject:refreshResultafterDelay:3];
}
-(void)refreshOver:(NSString*)result {
[self.arrayinsertObject:resultatIndex:0];
[self.tableViewreloadData];
//刷新完成停止刷新
[self.refreshControlendRefreshing];
}