Welcome to the Treehouse Community
The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.
Shape and Circle program compile results not what they should be
When I build, compile and run the example program we walk through in this lesson, my Circle area comes up as -1.000000 the same as the Shape area. All my code (Shape.h, Shape.m, Circle.h, Circle.m) is exactly the same as the instructors. I have made sure to go over it several times and yet I still don't get the results that show up for the instructor. Can someone please tell me what is going on?
Tom Holland24,288 Points
The problem is on line 5 of Circle.m
Your method is named -(float)radius when it should be -(float)area.
Tom you're absolutely right! Thank you! I knew it was something simple that I was missing. Appreciate it!