0

I am new to iphone programming?

Can anybody tell me difference between view and view controller??

is the same difference between table view and table view controller?

My understanding is that - like in MVC architecture

view controller - will acts as controller which having control on model and view.

view - it will come under View section of MVC.

model - .h .m files.

but how it defines/differs in technically.

one more Question - we can add view to view controller using addSubView. but how can we go in reverse.

please suggest me links which will clear my concepts.

Many Thanks in Advance.

medha123
  • 1
  • 2
  • Possible duplicate of [What is the difference between UIView and UIViewController?](https://stackoverflow.com/questions/4669783/what-is-the-difference-between-uiview-and-uiviewcontroller) – toraritte Dec 28 '17 at 19:13

1 Answers1

2

UITableView is a sub-class of UIView, and UITableViewController is a sub-class of UIViewController.

As for UIViewController, it has a property named view, which is the content view of UIViewController. The other view can be added to this content view.

As for UITableViewController, it has a property named tableView, which is the content view of UITableViewController. The tableView needs some one to implement UITableViewDataSource, which can provide the content of the cells on the tableView. By default, the one which implements UITableViewDataSource and UITableViewDelegate protocols is the UITableViewController.

The MVC pattern has many forms. It is little different under Qt, Cocoa, and MFC. Under Cocoa, you can read this page, Cocoa MVC.

AechoLiu
  • 17,522
  • 9
  • 100
  • 118