简体   繁体   English

在主UI线程之外的其他地方进行SQLite数据库提取

[英]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
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 iOS - Swift:在主线程中从数据库中获取数据,而不是在后台 - iOS - Swift : fetching data from database in main thread, not in background 串行队列(Main除外)代码是否在主线程上执行? - Is serial queue(other than Main) code execute on Main thread? iOS:在主线程以外的线程中调用 UIApplication 的方法是否安全? - iOS: is calling methods of UIApplication in thread other than the main thread safe? 用户界面未在主线程中更新 - UI not updating in main thread 如何在后台获取许多托管对象并在主线程上更新UI时有效使用CoreData? - How to use CoreData effectively in fetching many Managed Objects in the background and updating UI on the main thread? 尝试从主线程或Web线程以外的其他线程获取Web锁 - Tried to obtain the web lock from a thread other than the main thread or the web thread 试图从主线程或Web线程以外的线程获取Web锁。 现在崩溃了 - Tried to obtain the web lock from a thread other than the main thread or the web thread. Crashing now GCD错误:试图从主线程或Web线程以外的线程获取Web锁 - GCD ERROR :Tried to obtain the web lock from a thread other than the main thread or the web thread 从MySQL提取数据库到SQLite - Fetching database from MySQL to SQLite iOS GCD:主线程从主队列以外的队列中出列块? - iOS GCD: main thread dequeue blocks from queues other than main queue?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM