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

No ViewController.h in my project for Crystal Ball App

Did I create the wrong kind of project maybe? Any way to recover?

5 Answers

Amit Bijlani
STAFF
Amit Bijlani
Treehouse Guest Teacher

You can either start again and select "Single View Application" or add a View Controller by selecting File > New > File (Command+N) select Objective-C class name it "ViewController" and make it a subclass of "UIViewController"

Thanks, and we're not talking about MainViewController, right? ViewController is different and it should be there already?

Amit Bijlani
STAFF
Amit Bijlani
Treehouse Guest Teacher

Same thing. You might have an older version of Xcode

4.6.1.

Every time I make a new Single View Project (for iOS, under Application) it creates MainViewController.m and .h, not ViewController. So I have half my code in one, and half my code in the ViewController I made. As a result, I think, I see nothing it the logs (at all). I guess I will need to combine the two files.

EDIT: it seems to heave worked because I see "motion ended" in my log now.

Amit Bijlani
STAFF
Amit Bijlani
Treehouse Guest Teacher

Great! Whether your view controller is named 'MainViewController' or 'ViewController' it doesn't matter. As long as it generates a view controller when you use the Single View project template.