开发者

Relationships between File Owner, App Delegate, View Controller, etc

开发者 https://www.devze.com 2023-04-11 19:48 出处:网络
Based on the little that i know, I tried to put together the relationships usually seen as part of MainWindow xib.

Based on the little that i know, I tried to put together the relationships usually seen as part of MainWindow xib.

How far off am i? Kindly correct and advise.开发者_JAVA百科

Relationships between File Owner, App Delegate, View Controller, etc


Almost. View controllers inherit from uiwindows in the class system. And you have to think of it more like a pie chart. Everything is equally important, some are just more equal than others. On the top of the pie chart is the app delegate. It's the master of the app. It can reach into a view or Controller and pull whatever it wants. Now on the left side is a view. It's the dumb little sycophant of the whole thing. It can only recieved instructions from itself, or from the app delegate, then act on those instructions. It should never pull from the app delegate (not never, but most always) and DEFINITELY should never screw around with a controller. Finally, controllers. They are the brains of the whole app. They can't show information on screen like a view, but they can think pretty well. Controllers give the orders in your app. They shouldn't really pull from the app delegate, but they can (again, rarely). There's an excellent lecture from Standford or MIT (I'm forgetting now) in iTunes U about it. Look it up.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号