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 trialDaniel Popov
4,024 PointsImport Modal of header file in View Controller Header File
You touch on this at 1:58. I just wanted to understand more of the reason for this theory...
Daniel Popov
4,024 PointsI understand why one would generally import header files. In the video called "Updating Data" at around 2 min. You say that "You shouldn't import model header files in the view controller header files." I just wanted to understand a little more about this theory. I'm assuming it has to do with proper MVC structure I just wanted some clarification.
Thanks!
2 Answers
Ash Furrow
Treehouse Guest TeacherIt's about a matter of scope – when A imports B, and B imports C, then A effectively imports C. We want to avoid that whenever possible.
Daniel Popov
4,024 PointsI understand why one would generally import header files. In the video called "Updating Data" at around 2 min. You say that "You shouldn't import model header files in the view controller header files." I just wanted to understand a little more about this theory. I'm assuming it has to do with proper MVC structure I just wanted some clarification.
Thanks!
Ash Furrow
Treehouse Guest TeacherAsh Furrow
Treehouse Guest TeacherCan you clarify a little bit? You mean import the file in the header file? Usually it's to gain access to protocols defined in headers.