【发布时间】:2013-02-25 22:23:32
【问题描述】:
我无法刷新我的 TVC。当我向下拖动以刷新时,它崩溃了。 图标在那里,但随后它退出了。我敢肯定它很简单。还有一些类似的问题尚未考虑。
取自我的 viewDidLoad 方法体:
refreshControl = [[UIRefreshControl alloc] init];
[refreshControl addTarget:self
action:@selector(refreshInvoked:forState:)
forControlEvents:UIControlEventValueChanged];
[self.tableView addSubview:refreshControl];
refreshControl.attributedTitle = [[NSAttributedString alloc] initWithString:title
attributes:@{NSFontAttributeName:[UIFont fontWithName:@"Helvetica" size:13.0]}];
[self refreshFeed];
指的是:
-(void)refreshFeed
{
RSSLoader* rss = [[RSSLoader alloc] init];
[rss fetchRssWithURL:feedURL
complete:^(NSString *title, NSArray *results) {
dispatch_queue_t downloadQueue = dispatch_queue_create("downloader",NULL);
dispatch_async(downloadQueue, ^{
_objects = results;
[self.tableView reloadData];
//completed fetching the RSS
dispatch_async(dispatch_get_main_queue(), ^{
// [(HeaderView*)self.tableView.tableHeaderView setText:title];
// [(ArticleItem*)self.tableView.]
});
});
}];
}
【问题讨论】:
-
请在询问崩溃时包含崩溃日志,ACB 可能是对的,但为什么让我们猜测?
-
@jrturton,这是真的。我的回答纯粹是基于一个假设,可能是完全错误的。
标签: iphone ios asynchronous uirefreshcontrol