- (void)viewDidLoad {
[superviewDidLoad];
UIRefreshControl*refreshControl = [[UIRefreshControlalloc]init];
self.refreshControl= refreshControl;
[self.refreshControladdTarget:selfaction:@selector(refresh:)forControlEvents:UIControlEventValueChanged];
}
-(void)refresh:(UIRefreshControl*)sender {
NSLog(@"已经开始刷新");
//刷新获取的数据
NSString*refreshResult =@"赵六";
[selfperformSelector:@selector(refreshOver:)withObject:refreshResultafterDelay:3];
}
-(void)refreshOver:(NSString*)result {
[self.arrayinsertObject:resultatIndex:0];
[self.tableViewreloadData];
//刷新完成停止刷新
[self.refreshControlendRefreshing];
}