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

Staying DRY with Helper Methods in Ribbit... but no declaration in header file?

I totally understand not repeating yourself.

However, in Ribbit when we created the method reset... or using Xcode to create the method for us, it didn't set the method in the header file. Why?

1 Answer

When we created the reset method, we had no need to declare it in the header file as it was a method that would be used in that implementation of the class only (other classes wouldn't use it externally) However, if other classes were calling it, we'd put it in the header file too.

I talk a little about this in this thread.

Hope this helps!

Ahhh.. makes perfect sense. Thanks for answering!