有人能用一个例子解释一个委托人是什么? [英] Can someone explain what a delegate is with an example?

查看:112
本文介绍了有人能用一个例子解释一个委托人是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我读了很多关于目标c委托,但没有得到清楚的idea.Can任何人解释它与
一个好的和精确的例子,所以我可以理解它。高级感谢您的回复。

i read a lot about objective c delegate but didn't get clear idea.Can anyone explain it with a good and precise example so that i can understand it. Advanced thanks for your reply.

推荐答案

这里是我对代表的回答及其工作原理:在Cocoa中解析XML

Here's an answer I gave about delegates and how they work: Parsing XML in Cocoa

这通常被称为策略模式 ,您可以在维基百科上阅读所有相关内容: http://en.wikipedia.org/wiki/Strategy_pattern

It's most commonly known as the "Strategy Pattern", and you can read all about it on Wikipedia: http://en.wikipedia.org/wiki/Strategy_pattern

这也是对象组成的一个轻微变化: http://en.wikipedia.org/wiki/Object_composition

It is also a slight variation on object composition: http://en.wikipedia.org/wiki/Object_composition

这篇关于有人能用一个例子解释一个委托人是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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