技术上与视图控制器之间的区别? [英] difference between view and view controller technically?

查看:46
本文介绍了技术上与视图控制器之间的区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是iPhone编程的新手吗?

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?

我的理解是-就像在MVC架构中一样

My understanding is that - like in MVC architecture

视图控制器-将充当对模型和视图具有控制权的控制器.

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

视图-它位于MVC的视图"部分下.

view - it will come under View section of MVC.

模型-.h .m文件.

model - .h .m files.

,但是在技术上它是如何定义/不同的.

but how it defines/differs in technically.

另一个问题-我们可以使用addSubView将视图添加到视图控制器.但是我们该如何逆转.

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.

非常感谢.

推荐答案

UITableView是UIView的子类,而UITableViewController是UIViewController的子类.

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

对于UIViewController,它具有一个名为 view 的属性,它是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.

对于UITableViewController,它具有一个名为 tableView 的属性,它是UITableViewController的内容视图.tableView需要一些实现UITableViewDataSource的工具,它可以提供tableView上单元格的内容.默认情况下,实现UITableViewDataSource和UITableViewDelegate协议的是UITableViewController.

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.

MVC模式具有多种形式.在Qt,Cocoa和MFC下几乎没有什么不同.在可可下,您可以阅读此页面,可可MVC .

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

这篇关于技术上与视图控制器之间的区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆