This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds and have James Denton on-line!
See this thread for details.
Win a copy of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

New programmer of IOS: What are View Controllers?  RSS feed

 
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi

Please explain to me with clear demonstration What are View Controllers?


thanks
 
Ranch Hand
Posts: 47
1
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi! It's hard to understand what "clear" means for you.

Perhaps you've heard about Model-View-Controller idea? In short it is like this - the part of your program which is responsible for displaying information to user is logically split into:

- Views - think of them as simple templates which could be stuffed with necessary data;
- Models - data containers, some plain objects or arrays simply containing all data you want to inject into Views;
- Controllers - some classes or just methods which take care of preparing Models.

For example if I have a page with a list of users, then here is a template - some set of styles and layouts for this list, then there are data, for example an array of objects each representing single user (with the name and URL to his profile for example) an there is a code which, for example, checks whether you are allowed to see the list at all, requests the user names from one database table, then their urls from another table, then glues them together to create "Model".

Now back to your question. In IOS programming View Controller is a thing resembling this ideology. In short it is something which helps you to prepare your data and serve it to be displayed.

This article looks like it contains detailed enough overview of them. Feel free to ask if you feel that some specific part of their explanation look vague to you...
 
Mohammad Ashari Rahman
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the explanation and link..the site should be helpful
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!