ViewDidLoad在AppDelegate didFinishLaunchingWithOptions被执行之前运行! [英] ViewDidLoad runs before AppDelegate didFinishLaunchingWithOptions gets executed!
问题描述
我遇到一个奇怪的问题,方法ViewDidLoad在AppDelegate的didFinishLaunchingWithOptions执行之前运行!
因为我只检查数据库是否存在于didFinishLaunchingWithOptions中,如果数据库不存在,我的应用程序崩溃。在戳了几个小时后,我厌倦了这样做,并呼吁HEEEEELP!
如果你愿意的话可以这么善良,指出我的方案有可能是错误的,我的项目。我不能弄清楚(aaarggh!)
i am experiencing a strange problem where the Method "ViewDidLoad" runs before the AppDelegate's didFinishLaunchingWithOptions gets executed! Cause I only check if a database exists in "didFinishLaunchingWithOptions" my app crashes if the database isnt there. after poking around for a couple of hours I am tired of doing so and call for HEEEEELP! If you please could be so kind and point me into the right direction what's likely to be wrong with my project. I cant figure it out (aaarggh!)
谢谢!
最好的问候
汤姆
Best regards Tom
推荐答案
viewDidLoad可能在从NIB加载的ViewController上运行,因为这些在调用didFinishLaunchingWithOptions之前被加载:
viewDidLoad may run on ViewControllers loaded from NIBs as these are loaded before the call to didFinishLaunchingWithOptions:
这篇关于ViewDidLoad在AppDelegate didFinishLaunchingWithOptions被执行之前运行!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!