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

jon kelson
5,149 PointsHelp me please Understand Mvc in Xcode
Please help me to Understanding of the mvc
not completely clear what part on Xcode does what I know the view is where you put the buttons etc the part you see in the centre of Xcode, So I have three questions. ..... the "view" is the centre part where you put your objects and buttons .etc the "model" is on the right ? where you write your code functions etc. I think you can call your stored files from here? Mainly where is the "controller" ? I know it communicates between the model and view but Can you see the controller and do we add any code to it when writing a program . Hope you can help . many thanks
1 Answer

jcorum
71,830 PointsJon, left and right may not be the best way to think about the MVC design pattern.
Yes, the View is the Storyboard and any other views in an app, and it usually shows up in the middle of the IDE.
The Controller is one or more files like ViewController.swift, and these files usually show up to the right of the Storyboard.
The Model will be one or more files, separate from the controllers, that contain data, access plists, access core data, access network data or databases, etc.
The above is rather simplistic, and much more can be said about MVC. For more detail, try Apple's documentation: https://developer.apple.com/library/mac/documentation/General/Conceptual/DevPedia-CocoaCore/MVC.html
Happy coding.
jon kelson
5,149 Pointsjon kelson
5,149 PointsThanks jcorum, I had a read through I understand a lot more now I think . Just one more question, in your above answer you say access data etc . I'm not sure what these are . But am I right in thinking we write most of our code to develope an app in Xcode where the controllers files are and we don't have to do much or anything with these Model files such as access core data ? Or am I still getting confused .