ios - UIView 和 UIViewController 有什么区别?

标签 ios class uiview uiviewcontroller composition

我需要以下方面的详细解释:

我们使用 UIViewController 做什么? 有什么用?

我有一个如下所示的类:

class one
{
    UINavigationController *nav = ...;

    two *secondObject = ...;

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

如何在 one 类中使用 secondObject

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

最佳答案

UIViewController MVC 中的 Controller 部分 设计模式。

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

Controller 的任务是处理不同 View 之间的导航、按键和屏幕触摸等。

关于ios - UIView 和 UIViewController 有什么区别?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4669783/

相关文章:

iphone - iOS 5 中的规范音频样本数据类型是什么

ios - Mac 和 Windows Excel

excel - 用户定义类型与类速度

ios - 更改 UIImageView 的图像属性的问题

ios - wait_fences : failed to receive reply: 10004003 (only on iPad)

ios - 检测表在 iOS 13 上被取消

ios - 需要指导在 Cordova 应用程序中使用 native APNs/GCM 为 iOS 推送通知

python - Python 类名中的前导下划线

php - get_status() 函数返回 1 而不是 true 或 false,为什么?

objective-c - [UIView removeFromSuperview] 是否也递归删除其 subview ?