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 Objective-C Basics (Retired) Introduction to Objective-C Inheritance

What is the difference between importing a class header and using its methods, and using a @protocol?

Hi,

I'm already ahead of this but I've really found this bit a little confusing. What is the difference between importing a class header in another class and using the methods provided by that class, and using a protocol?

If I understand correctly, a protocol is used so a class can have extended functionality by using certain methods from other classes... How is this any different from importing a class header into the implementation of the class you want those methods to be implemented on?

Thanks Vedant