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 Build a Simple iPhone App (iOS7) Refactoring into a Model Readonly Attribute

Soojin Ro
Soojin Ro
13,331 Points

Why do we use @class?

Amit says "It's not a good practice to import in local interface". Why? What's the difference between importing in .h file and .m file?

1 Answer

Amit Bijlani
STAFF
Amit Bijlani
Treehouse Guest Teacher

Header files (or .h files) are a quick way of instructing a compiler the basic structure of your app. The compiler gets an understanding of the classes and frameworks needed by your app. If you import a local header file inside another header files then it creates unnecessary overhead. With a small application you will not notice much difference but as you application grows so will your compile time. Keeping in mind this basic rule will help you when creating a real world application.