0
當下面的代碼運行時(一旦它進入方法),就會有幾秒的凍結。我甚至無法向上或向下滾動。我試圖通過使用塊刪除它,但即使下面的代碼仍然凍結。下面是代碼:prepareForSegue:在目標C上使用塊
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
dispatch_queue_t downloadQueu= dispatch_queue_create("downloader",NULL);
dispatch_async(downloadQueu, ^{
NSDictionary *placeDictionary =
[self.topPlaces objectAtIndex:self.tableView.indexPathForSelectedRow.row];
dispatch_async(dispatch_get_main_queue(), ^{
[[segue destinationViewController] setPhotoList:[FlickrFetcher photosInPlace:placeDictionary
maxResults:50]
withTitle:[[sender textLabel] text]];
});
});
}