【发布时间】:2011-07-18 18:41:37
【问题描述】:
当我在 TTTableViewController 中的连接超时时,有没有办法启用刷新?似乎用户在超时时无法执行任何操作。请指教
【问题讨论】:
标签: iphone objective-c ipad three20
当我在 TTTableViewController 中的连接超时时,有没有办法启用刷新?似乎用户在超时时无法执行任何操作。请指教
【问题讨论】:
标签: iphone objective-c ipad three20
我做了其他事情来解决这个问题。如果表格中没有内容,我会在 UINavigationBar 上显示一个刷新按钮,该按钮手动调用拉动刷新委托:
///////////////////////////////////////////////////////////////////////////////////////////////////
- (void)viewDidAppear:(BOOL)animated {
[super viewDidAppear:animated];
if ([Stations count]==0) {
self.navigationItem.rightBarButtonItem = [[[UIBarButtonItem alloc]
initWithBarButtonSystemItem:UIBarButtonSystemItemRefresh
target:self
action:@selector(reload)] autorelease];
}
}
///////////////////////////////////////////////////////////////////////////////////////////////////
- (void)reload {
if ([self.tableView.delegate isKindOfClass:[TTTableViewDragRefreshDelegate class]]) {
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:ttkDefaultFastTransitionDuration];
self.tableView.contentOffset = CGPointMake(0, -60.0f);
[UIView commitAnimations];
}
[super reload];
}
如果数据源加载成功,您可以隐藏 rightbarbuttonitem。
【讨论】: