OC 面试中的消息机制:KVO,NSNotification,Delegate,Protocol
来源:互联网 发布:混合云 数据复制 编辑:程序博客网 时间:2024/06/05 07:59
这个问题问的就在考察你是否对于OC是否有一个真正的理解:
我的不理解的地方就在于NSNotification和Protocol的区别;实话这俩的没啥关系。但是把上面四个都整到一起就很有意思了:
NSNotification的特点在于:被观察者通知观察者,然后才开始工作,通过NSNotificationCenter来统一控制;
KVO也是一个消息响应机制,在使用UITableView的时候,滑动消息,可以通过KVO的模式实现;
对于delegate代理是需要可protocol区分的,protocol是不需要实现你定义的协议的,而delegate的所有方法基本上在代理中都要实现;
0 0
- OC 面试中的消息机制:KVO,NSNotification,Delegate,Protocol
- NSNotification、delegate和KVO的区别
- NSNotification、delegate和KVO的区别
- NSNotification、delegate和KVO的区别
- NSNotification、delegate和KVO的区别
- NSNotification、delegate和KVO的区别
- NSNotification、delegate和KVO的区别
- NSNotification、delegate和KVO的区别
- NSNotification、delegate和KVO的区别
- NSNotification、delegate和KVO的区别
- NSNotification、delegate和KVO的区别
- NSNotification、delegate和KVO的区别
- NSNotification、delegate和KVO的区别
- NSNotification、delegate和KVO的区别
- NSNotification、delegate和KVO的区别
- NSNotification、delegate和KVO的区别
- NSNotification、delegate和KVO的区别
- NSNotification、delegate和KVO的区别
- Android底部Tab页基于ViewPager的实现
- cout的输出格式初探
- 软件开发模型
- 爱奇艺算法工程师面试题(2015年)
- Activity
- OC 面试中的消息机制:KVO,NSNotification,Delegate,Protocol
- [数据结构]线性结构——串
- 快速数论变换(NTT)
- hive常用操作
- Leetcode__链表练习
- 让非root用户能使用wireshark捕捉网络数据包
- requireJS目录
- 《Opencv入门》指针遍历
- 雷神G150TH 拆机清理风扇