ViewDidLoad starts before AppDelegate doneFinishLaunchingWithOptions starts!

I had a strange problem when the "ViewDidLoad" method starts before running AppDelegate doneFinishLaunchingWithOptions! Cause. I only check if the database exists in "didFinishLaunchingWithOptions" when my application crashes if the database does not exist. after poking a couple of hours, I'm tired of it and urge HEEEEELP! If you are perhaps so kind and point me in the right direction, what might be wrong with my project. I can't figure it out (aaarggh!)

Thanks!

Regards Tom

0
source share
4 answers

viewDidLoad can run on ViewControllers loaded from the NIB, as they are loaded before the didFinishLaunchingWithOptions call:

+3
source

I had the same problem, and looking at the code in more detail, I found that inside awakeFromNib xViewController I am running another yViewController. So viewDidLoad yViewController runs until didFinishLaunchingWithOptions:

Basically, the initial VC awakeFromNib is called before didFinishLaunchingWithOptions: You may have something similar to a setting. Look at this.

0
source

If your database files do not load fast enough; override AppDelegate init ():

 override init() { if filesExistBool == false { addDBFiles() } } 
0
source

I do not trust you.

In application:didFinishLaunchingWithOptions: you determine which views to load. The application will not randomly download submissions unless you inform him of this. You set a breakpoint first in viewDidLoad and first in application:didFinishLaunchingWithOptions: or just assume that application:didFinishLaunchingWithOptions: failed because it does not work.

-1
source

All Articles