delegate、notification、KVO的使用场景总结
来源:互联网 发布:怎么做淘宝客服怎么找 编辑:程序博客网 时间:2024/04/24 11:46
假如A和B需要通信,B需要获取A的消息
首先是delegate和notification这两个,A和B之间有相互的关联用delegate,若A和B毫无联系就该用notification。
然后是KVO,delegate和notification是A和B双方合作的事情,而KVO是B单方面的事情。A有消息了,A通知B,这是delegate;A有消息了,A通知notificationCenter,notificationCenter广播给B,这是notification;A不漂亮,B无感,B偷窥A,A变漂亮了,B心动了,这是KVO。
PS,再初学delgate的时候,网上解释dellegate概念的时候很多都这样的,A委托B干嘛干嘛,当时总觉得有些糊涂,现在回头来看,主次搞错了好伐,应该是B申请A把事情给他干。就像是厂商的代理一样,你要做我的代理(delegate声明),你就必须符合我的条件(delegate实现),起码必须要卖我的东西是吧,这样每当我有产品,才能直接通知代理来卖。
0 0
- delegate、notification、KVO的使用场景总结
- KVO、Delegate、Notification 区别及相关使用场景
- Delegate,notification,KVO的区别
- Notification,Delegate,KVO,Block的浅易理解
- Delegate,Notification,KVO
- Delegate,Notification,KVO
- Delegate,Notification,KVO
- delegate、notification和KVO
- delegate,notification,kvo比较
- Delegate, Notification,KVO优缺点
- Delegate Notification KVO 整理
- delegate , Notification , protocal , KVC , KVO
- 如何选择delegate、notification、KVO
- 如何选择delegate、notification、KVO
- 如何选择delegate、notification、KVO?
- KVO KVC Notification Delegate Block
- delegate、notification、KVO各优缺点
- KVO、Notification、Delegate 三个概念的深入理解整理
- Runtime使用场景
- java项目相对路径问题
- APUE之线程(五)
- Spring操作Mongodb
- 数据结构与算法——AVL树简介
- delegate、notification、KVO的使用场景总结
- 软件工程-web软件设计
- Android UI 控件之TextView
- 【架构篇】Android移动app架构设计浅谈
- 小白笔记--------------二分搜索算法
- 字符串应用(2)基本例程
- MR案例之倒排索引TF-IDF
- FragmentTransaction的commit的异步操作
- win7win8 64位汇编开发环境合集安装与设置