【发布时间】:2014-03-12 14:32:37
【问题描述】:
我在 UITableView 中使用 UIRefreshControl:
UIRefreshControl *refreshControl = [[UIRefreshControl alloc] init];
[refreshControl addTarget:self action:@selector(refresh)
forControlEvents:UIControlEventValueChanged];
self.refreshControl = refreshControl;
使用刷新处理程序:
-(void)refresh {
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
// (...some long running operation...)
dispatch_async(dispatch_get_main_queue(), ^{
[self.refreshControl endRefreshing];
});
});
}
在长时间运行的操作中,我按下主页按钮使应用程序处于非活动状态。之后,我再次使应用程序处于活动状态。微调器冻结(停止旋转)并且无法将其返回到初始状态。
如何解决?
【问题讨论】:
标签: ios cocoa-touch uitableview uirefreshcontrol