示例:
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT,0), ^{
//处理耗时动作
NSMutableArray *findArray = [[NSMutableArray alloc] init];
for (int i = 0; i < [_userList count]; i++) {
NSArray *secondArray = [_userList objectAtIndex:i];
for (int j = 0; j < secondArray.count; j++) {
//解密操作
}
}
filterList = findArray;
//通知主线程刷新
dispatch_async(dispatch_get_main_queue(), ^{
//回调或者说是通知主线程刷新,
[self.searchDisplayController.searchResultsTableView reloadData];
});
});