问题描述
delegate在iphone中的确切含义是什么?它在UIViewController中是如何实现的?
what is the exact meaning of delegate in iphone?how it is implemented in UIViewController?
推荐答案
委托是一个对象,它通常对另一个对象中的某些事件做出反应和/或可以影响另一个对象的行为方式.为了更好地完成任务,这些对象协同工作.通常,委托对象将由许多其他需要执行更具体任务的对象共享.委托本身将更加抽象,并且对于不同的任务应该是非常可重用的.包含委托的对象通常会在触发事件发生时向委托发送消息,使委托有机会执行其指定的任务.
A delegate is an object that usually reacts to some event in another object and/or can affect how another object behaves. The objects work together for the greater good of completing a task. Typically a delegate object will be shared by many other objects that have a more specific task to carry out. The delegate itself will be more abstract and should be very reusable for different tasks. The object which contains the delegate typically sends the delegate a message when a triggered event occurs, giving the delegate an opportunity to carry out its specified task.
还有更多文档这里 您应该阅读以了解 Cocoa 和 Cocoa touch 中的委托模式,特别是如何在 UIWindow 和 UIView 之间使用委托.它是 iPhone 架构中不可或缺的设计模式,如果你想设计一个干净的应用程序,你应该掌握它.
There's more documentation here that you should read to understand the delegate pattern in Cocoa and Cocoa touch, particularly with how delegation is used between UIWindow and UIView. It is an integral design pattern in iPhone architecture and one that should be mastered if you wish to design a clean application.
这篇关于iPhone 中的代理是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!


大气响应式网络建站服务公司织梦模板
高端大气html5设计公司网站源码
织梦dede网页模板下载素材销售下载站平台(带会员中心带筛选)
财税代理公司注册代理记账网站织梦模板(带手机端)
成人高考自考在职研究生教育机构网站源码(带手机端)
高端HTML5响应式企业集团通用类网站织梦模板(自适应手机端)