i'm trying to load an initial view with an image for 5 seconds and then suspend and load a tabBarController in my AppDelegate file. At the moment i can only load one or the other.
I tried creating a method inside the initalviewcontroller to suspend the view after delay but Xcode gives me a warning that my ViewController may not respond to the method in the appDelegate file. Here's my code at the moment
App Delegate File Code
And the code for the method in the viewController file
Is there a better or easier way to do this?
I tried creating a method inside the initalviewcontroller to suspend the view after delay but Xcode gives me a warning that my ViewController may not respond to the method in the appDelegate file. Here's my code at the moment
App Delegate File Code
Code:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
SplashViewController *theSplashViewController = [[SplashViewController alloc] initWithNibName:@"SplashViewController" bundle:nil];
// Override point for customization after application launch
[window addSubview:[theSplashViewController view]];
[window makeKeyAndVisible];
[splashController showSplash];
[window addSubview:[rootTabBarController view]];
return YES;
}
And the code for the method in the viewController file
Code:
-(void)showSplash
{
UIViewController *modalViewController = [[UIViewController alloc] init];
modalViewController.view = splash;
[self presentModalViewController:modalViewController animated:NO];
[self performSelector:@selector(hideSplash) withObject:nil afterDelay:5.0];
}
//hide splash screen
- (void)hideSplash
{
[[self modalViewController] dismissModalViewControllerAnimated:YES];
}
Is there a better or easier way to do this?