테이블에 두 섹션을 잠깐 업데이트하는 방법이 있습니다. 나는 다음과 같이하고 싶다.백그라운드 처리 방법에서 동일한 디스패치 대기열을 사용합니다.
dispatch_queue_t lowQueue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_LOW, 0);
dispatch_queue_t mainQueue = dispatch_get_main_queue();
dispatch_async(lowQueue, ^{
NSArray *tempArray = // do long running task to get the data
dispatch_async(mainQueue, ^{
// update the main thread
[self.activityIndicatorView stopAnimating];
[self.reportsTableView reloadData];
});
});
dispatch_async(lowQueue, ^{
NSArray *tempArray2 = // same thing, do another long task
// similarly, update the main thread
같은 방법으로 같은 lowQueue를 사용하면 괜찮습니까? 감사.