Search code examples
iphoneuiviewcontrollersplash-screenviewdidloadviewdidappear

iOS Root View Controller's viewDidAppear: called while splash screen (Default.png) still on screen


In my iOS app I want to run a series of operations in my Root View Controller after it has already appeared on the screen. However, it seems that the iOS app is calling viewDidAppear while the splash screen (i.e. showing the Default.png image) is still on the screen and before the root view controller is laid out on the screen. I've tried the same code in viewDidLoad as well, and had the same problem. How can I force code to run only once the root view controller is actually on-screen?


Solution

  • in viewdidload use this

    [self performSelector:@selector(loadData) withObject:nil afterDelay:.5];
    

    and then use your code inside loaddata method...