简体   繁体   English

iOS最佳做法为应用程序预加载数据

[英]iOS Best Practice Preloading Data for App

I have an App that works from a Tab Bar Controller. 我有一个可以从选项卡栏控制器工作的应用程序。 But before I get to that menu I need to preload and run some database checks. 但是在进入该菜单之前,我需要预加载并运行一些数据库检查。 What is the best way to do this as it only needs to run once and not every time you return to the Home Page. 这样做的最佳方法是什么,因为它只需要运行一次,而不必每次返回首页时都运行一次。 This needs to sit between the Launch Images and the Home Page. 这需要位于启动图像和主页之间。

What's the best way to do this? 最好的方法是什么?

How about doing it in the app delegate's application:willFinishLaunchingWithOptions: method? 在应用程序委托的application:willFinishLaunchingWithOptions:方法中如何做? That's where I initialize the Core Data stack. 那是我初始化核心数据堆栈的地方。

You could execute the check on a background thread, so that your views continue to load. 您可以在后台线程上执行检查,以便继续加载视图。

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

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