2016.9.9
//主线程队列
dispatch_queue_tmainQueue;
//子线程队列
dispatch_queue_tqueue;
//异步获取不然通讯录过多的时候可能阻塞线程几秒钟体验不好
dispatch_async(queue, ^{
[_viewModelseeContactsUsingApp:tmpPeoplessuccess:^(BOOLresult) {
self.contactArrays= [[NSMutableArrayalloc]init];
self.contactArrays=_viewModel.nameAndPhoneArray;
self.serverArray=_viewModel.contactArrays;
_rowArr= [ContactDataHelpergetFriendListDataBy:self.contactArrays];
_sectionArr= [ContactDataHelpergetFriendListSectionBy:[_rowArrmutableCopy]];
dispatch_async(mainQueue, ^{
[selfhideWaiting];
[_tableViewreloadData];
});
}failure:^(NSString*error) {
dispatch_async(mainQueue, ^{
[selfhideWaiting];
});
}];
});
网友评论