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
Paul Denlinger
3,292 PointsAdding A Table View Controller Class Error Message
Have followed the lesson and am getting an error message, even though the program compiles. The error message reads:
Application windows are expected to have a root view controller at the end of application launch
The contents of the array also don't display in the view.
FYI, I am running Xcode 5 and iOS 7, which is different from the course content.
1 Answer
Amit Bijlani
Treehouse Guest TeacherIf you are using Xcode 5 then you probably don't need to add the code to your AppDelegate because it is all created for your within the Main.Storyboard.
Paul Denlinger
3,292 PointsPaul Denlinger
3,292 PointsOK, I figured out what I did wrong; I didn't take out the reference to the window in the first line of didFinishLaunchingWithOptions method in AppDelegate.m.
Once I removed that, the table displayed fine.
Can you explain why removing the window reference makes it display? Isn't every application supposed to have an instance of window?
Amit Bijlani
Treehouse Guest TeacherAmit Bijlani
Treehouse Guest TeacherThe Storyboard takes care of the window so you don't need to create one within your code. Apple has been moving towards a more Storyboard-centric approach whereas previously a lot of the work was done using code.