Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

iOS

Cannot get the "Expected a root view controller" problem resolved

I cannot get the "Application windows are expected to have a root view controller at the end of the application launch" error resolved from the 'Build a self-destructing Message iPhone app' tutorial that is discussed towards the end of video: http://teamtreehouse.com/library/build-a-selfdestructing-message-iphone-app-2/designing-and-starting-the-app/a-storyboard-with-a-tab-bar-controller.

Removing the following lines of code from the didFinishLaunchingWithOptions method in the AppDelegate.m doesn't solve the problem: self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; self.window.backgroundColor = [UIColor whiteColor]; [self.window makeKeyAndVisible];

Running the simulator after removing these lines of code makes the simulator go black. I am currently using Xcode 5. Can somebody help me resolve this problem?

Ben Jakuben
Ben Jakuben
Treehouse Teacher

Can you post all the code for your entire didFinishLaunchingWithOptions method?

2 Answers

did you leave return YES; in that method? did you set your storyboard as the main storyboard of your app?

@Stone: I figured the solution to the problem. You are almost right with the storyboard setting. While Xcode 5 doesn't have the option to set the "main storyboard", setting the 'Main Interface' to my storyboard solved the problem. Thank you the suggestion.

awesome glad you figured it out