UIView 和 UIViewController 有什么区别?
我需要详细解释以下内容:
我们使用 UIViewController
做什么? 它有什么用呢?
我有一个如下所示的类:
class one
{
UINavigationController *nav = ...;
two *secondObject = ...;
// By use of it, I have push the new view class two//ok
}
class two
{
...
}
如何在 one
类中使用 secondObject
?
什么是从窗口开始的类层次结构?
I need a detailed explanation on the following:
What do we use a UIViewController
for?
What is the use of it?
I have a class that looks like the following:
class one
{
UINavigationController *nav = ...;
two *secondObject = ...;
// By use of it, I have push the new view class two//ok
}
class two
{
...
}
How can I use secondObject
in the class one
?
What is the class hierarchical start from the window?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
UIViewController
是MVC
设计模式中的控制器部分。模型
<-------->
控制器
<-------->
View
控制器的任务是处理不同视图之间的导航、按键和屏幕触摸等。
The
UIViewController
is the controller part in theMVC
design pattern.Model
<------->
Controller
<------->
View
The controller's task is to handle navigation between different views, key presses, and screen touches etc.
视图只是一个对象,有点像一张纸,上面放置了其他对象。
视图控制器是一个控制视图的对象,可以在导航堆栈中向前和向后推送和弹出视图。
"iOS 视图控制器编程指南"
A view is merely an object, kind of like a piece of paper, that other objects are put onto.
A View Controller is an object that controls views, pushing and popping them forwards and backwards in a navigation stack.
"View Controllers Programming Guide for iOS"