我無法刷新我的TVC。當我拖下來刷新時,它崩潰。圖標在那裏,但隨後退出。我確定它很簡單。那裏有類似的問題沒有被考慮過。UIRefreshControl在刷新Tableview控制器時崩潰
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 2013-02-25 22:34:58
@ jrturton,的確如此。我的答案純粹是基於一個假設,可能是完全錯誤的。 – iDev 2013-02-25 22:37:32