简体   繁体   中英

SQLite Database fetching on other than main UI thread

在tableview上显示带有多个映射表的sqlite数据库中的大量数据。在tableview单元上显示具有映射表平均和的映射表中的平均数据。该计算部分需要在UI线程之外进行,如果计算出来则重新加载到tableview单元上,例如加载容易。请帮助我完成该任务。

This might help,

DispatchQueue.global(qos: .background).async {
    //Do your calculation here
}

DispatchQueue.main.async {
   //Reload Tableview here
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM