美文网首页
iOS 线程

iOS 线程

作者: 夏天爱西瓜汁 | 来源:发表于2017-11-28 11:21 被阅读59次

    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];

    });

    }];

    });

    相关文章

      网友评论

          本文标题:iOS 线程

          本文链接:https://www.haomeiwen.com/subject/zbbdbxtx.html