MCQs > IT & Programming > IOS Technical Test > Consider the following code: (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // Set Background Color/Pattern self.window.backgroundColor = [UIColor blackColor]; self.tabBarController.tabBar.backgroundColor = [UIColor clearColor]; //self.window.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@'testbg.png']]; // Set StatusBar Color [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleBlackTranslucent]; // Add the tab bar controller's current view as a subview of the window self.window.rootViewController = self.tabBarController; [self.window makeKeyAndVisible]; return YES; } How can the error be corrected that gets thrown in the console, 'Applications are expected to have a root view controller at the end of application launch'?

IOS Technical Test MCQs

Consider the following code:

(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

    // Set Background Color/Pattern

    self.window.backgroundColor = [UIColor blackColor];

    self.tabBarController.tabBar.backgroundColor = [UIColor clearColor];

    //self.window.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"testbg.png"]];

 

    // Set StatusBar Color

    [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleBlackTranslucent];

 

    // Add the tab bar controller's current view as a subview of the window

    self.window.rootViewController = self.tabBarController;

    [self.window makeKeyAndVisible];

    return YES;

}

How can the error be corrected that gets thrown in the console, "Applications are expected to have a root view controller at the end of application launch"?

Answer

Correct Answer: MenuViewController *menuViewController = [[MenuViewController alloc]init]; self.window.rootViewController = menuViewController;

Explanation:

Note: This Question is unanswered, help us to find answer for this one

IOS Technical Test Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it

search

IOS Technical Test Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it