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 trialDawid Cedrych
15,108 Pointslittle error
When I make motionBegan and other motion methods, my project behaves like these methods were not declared before, do you have any idea why? I downloaded Amit's project and there's no additional lines of codes in .h, nevertheless .m file recognizes motion methods…Do I miss something?
6 Answers
Holger Liesegang
50,595 PointsWhat do you mean by "my project behaves like these methods were not declared before"? Do you get any errors?
BTW you don't have to declare
- (void)motionBegan:(UIEventSubtype)motion withEvent:(UIEvent *)event
- (void)motionCancelled:(UIEventSubtype)motion withEvent:(UIEvent *)event
- (void)motionEnded:(UIEventSubtype)motion withEvent:(UIEvent *)event
in the THViewController.h because THViewController inherits from UIViewController and UIViewController from the UIResponder Class where the above given instance methods are already declared.
You might want to have a look at UIResponder Class Reference
Holger Liesegang
50,595 PointsHi Dawid,
would you mind elaborating on this matter, please?
Dawid Cedrych
15,108 PointsSorry, I've already edited my post
Dawid Cedrych
15,108 PointsYes, but on the video when Amit typed "motion" he has got auto-prompt motionBegan, but when I start typing "motion" I do not have any auto-prompt, which means that implementation file cannot find it in header.
Holger Liesegang
50,595 PointsTry typing -motion (with the - and no space between "-" and "motion") that will start the auto completion.
Dawid Cedrych
15,108 PointsDoesn't work…. take a look http://i57.tinypic.com/2hd4b60.png
Dawid Cedrych
15,108 PointsAlright, my stupid mistake, I overlooked one braces and tried to type it inside other method, what a silly mistake!! Sorry everybody!