iPhone 控制器交互
我从 iPhone 编程和 Objective C 开始,我有一些书籍和一些教程可以开始,但我有一个疑问,但我找不到答案。
我喜欢 MVC,所以我有视图、与视图和模型交互的控制器。 但是,我有一个与其他控制器交互的主控制器吗?
例如,我有 personaController、personView 和 person 类作为模型的一部分。 我有其他模式类,例如 family,带有 familyView,我需要 familyController 类吗?我应该将所有内容放在一个主控制器类中吗?
如果我应该有多个控制器(每个模型类一个),它们如何交互?例如,我显示 familyview,并且想要显示一个人的数据,那么需要 personController 对吗?我应该先找到一个主控制器,然后再从那个主控制器转到 personController 吗?
一张照片来展示我的观点。 在此处输入链接描述
我希望它能消除我的疑问。如果有人知道一些很好的书或教程,我很感激。提前谢谢!
Im starting with iPhone programming and objective c, i got some books and some tutorials to start with but i got one doubt and i cant find the answer for it.
I love mvc, so i have the view, the controller that interact with view and the model.
But, do i have a main controller that interact with other controller?
for example, i have personaController, personView and person class as part of model.
I have other mode class like familly, with a famillyView and do i need famillyController class ? should i put all in one main controller class?
if i should have more than one controller (one for each model class), how they interact? For example, i show famillyview, and want to show data from one person, so need personController right? should i got to one main controller and from that one to personController?
a pic to show my point of view. enter link description here
I hope its get clear my doubt. If someone know some rly good book or tutorial i appreciate it. Thx in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我用过这个 示例
与控制器交互。
i used this example
to interact with controllers.
iOS 编程使用 Model/View/ViewController 感知。
型号->正如您提到的,包含应用程序的内容和数据的类。个人/家庭和诸如此类的课程。
浏览次数-> iOS中所有的UI表单都继承自这个类。视图不是屏幕,它是包含在屏幕中的对象。
视图控制器 ->您可以将 ViewController 引用到屏幕,每个视图控制器都包含一个主根视图,该主视图可以包含多个视图,并且这些视图可以包含更多子视图等。
iOS programming uses Model/View/ViewController perception.
Models -> the classes that contains the guts and data of your application, like you mentioned. Person/Family and those sort of classes.
Views -> all the UI forms in iOS inherit from this class. a View is not a screen, it's an object that is contained in a screen.
ViewControllers -> you can refer ViewControllers to screens, each of them contain one main rootview that can contain multiple views, and those view can contain more subview and so on.