UIView和UIViewController有什么区别? [英] What is the difference between UIView and UIViewController?

查看:272
本文介绍了UIView和UIViewController有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要对以下内容进行详细说明:

I need a detailed explanation on the following:

我们使用 UIViewController
它的用途是什么?

What do we use a UIViewController for? What is the use of it?

我有一个类如下所示:

class one
{
    UINavigationController *nav = ...;

    two *secondObject = ...;

    // By use of it, I have push the new view class two//ok
}
class two
{
 ...
}

如何使用 secondObject

How can I use secondObject in the class one?

从窗口开始的类分层是什么?

What is the class hierarchical start from the window?

推荐答案

UIViewController 设计模式。

The UIViewController is the controller part in the MVC design pattern.

模型 < -------> 控制器 <-------> 查看

Model<------->Controller<------->View

控制器的任务是处理不同视图,按键和屏幕触摸等之间的导航。

The controller's task is to handle navigation between different views, key presses, and screen touches etc.

这篇关于UIView和UIViewController有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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