AppDelegate文件在哪里适合MVC? [英] Where does the AppDelegate file fit into MVC?

查看:135
本文介绍了AppDelegate文件在哪里适合MVC?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在学习iPhone / iPad编程。我相信我理解MVC的概念;我遇到的困难是理解如何正常的iPhone / iPad应用程序中的一些文件适合MVC。

I'm learning iPhone/iPad programming. I believe I understand the concept of MVC; what I'm having difficulty with is understanding how some of the files in a normal iPhone/iPad application fit into MVC.

当您使用视图Application Application模板创建AppDelegate.m和AppDelegate.h文件。

When you create a new application using the "View-Based Application" template an AppDelegate.m and AppDelegate.h file is created.

是模型,视图还是控制器文件?我猜这其实不是那些。我希望我可以看到一个图表或流程图,显示应用程序中每个文件属于什么类别。

Is that a Model, View, or Controller file? I'm guessing it's actually none of those. I wish I could see a diagram or a process flowchart that shows what category each file in the application falls into.

推荐答案

文件将适合特定的类别,但是,我不得不说,在这个实例中AppDelegate是一个控制器,它不可视化呈现数据(视图),也不代表实际数据(模型),但它确定什么视图控制器在应用程序启动时显示等等并管理其他视图(状态栏等)。

Not every file will fit a particular category, however, I would have to say in this instance the AppDelegate is a controller, it doesn't visually present data (a view) nor does it represent the actual data (a model) but it does determine what view controllers to show etc and manage other views (status bar etc) at the start of the application.

我不必担心尝试将每个文件分类MVC,有些只是不完美,如果有的话。

I wouldn't worry too much about trying to classify every file into MVC, some just won't fit perfectly, if at all.

这篇关于AppDelegate文件在哪里适合MVC?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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