protocol 类似于接口,可以实现函数的回调

@protocol MyDelegate<NSObject>
-(void)myCallbackFunction;
@end //Caller 添加一个delegate 的property:
//.h文件
@property (nonatomic,weak) id <MyDelegate> mDelegate;
//caller的函数中就可以调用
//.m文件
@synthesize mDelegate; [self.mDelegate myCallbackFunction]; //Callee:
//.h文件
@interface Caller : NSObject <MyDelegate>
//.m文件
[caller setValue:self forKey:@"mDelegate"]; //然后就可以在callee文件中写myCallbackFunction的implementation了。
-(void)myCallbackFunction{ }

Objective C Protocol implementation的更多相关文章

  1. objective c, protocol

    OC中协议类似于java中的接口,在多个类具有类似的方法时可以将这些方法定义到protocol中,然后各个类分别实现protocol中的各个方法. 例:有两个类Square和Circle, 定义一个p ...

  2. However, a general purpose protocol or its implementation sometimes does not scale very well.

    https://netty.io/wiki/user-guide-for-4.x.html The Problem Nowadays we use general purpose applicatio ...

  3. jmeter中Implementation中几个选项的区别

    在jmeter发送http请求时,Implementation下拉框中有几个选项,如下: 那到底有什么区别呢?发送http请求改用哪种方法呢.百度后查之,没答案.我们还是看官方文档吧.官方文档解释如下 ...

  4. SAE/ISO standards for Automotive

    On-Board Diagnostics J1962 Diagnostic Connector Equivalent to ISO/DIS 15031-3: December 14, 2001J201 ...

  5. Automake

    Automake是用来根据Makefile.am生成Makefile.in的工具 标准Makefile目标 'make all' Build programs, libraries, document ...

  6. iOS - Swift Enumerations or how to annoy Tom

    @import url(http://i.cnblogs.com/Load.ashx?type=style&file=SyntaxHighlighter.css);@import url(/c ...

  7. High Performance Networking in Google Chrome

    小结: 1. 小文件存储于一个文件中: 在内部,磁盘缓存(disk cache)实现了它自己的一组数据结构, 它们被存储在一个单独的缓存目录里.其中有索引文件(在浏览器启动时加载到内存中),数据文件( ...

  8. Networked Graphics: Building Networked Games and Virtual Environments (Anthony Steed / Manuel Fradinho Oliveira 著)

    PART I GROUNDWORK CHAPTER 1 Introduction CHAPTER 2 One on One (101) CHAPTER 3 Overview of the Intern ...

  9. LIST OF NOSQL DATABASES [currently 150]

    http://nosql-database.org Core NoSQL Systems: [Mostly originated out of a Web 2.0 need] Wide Column ...

随机推荐

  1. 剑指Offer——字符流中第一个不重复的字符

    题目描述: 请实现一个函数用来找出字符流中第一个只出现一次的字符.例如,当从字符流中只读出前两个字符"go"时,第一个只出现一次的字符是"g".当从该字符流中读 ...

  2. 自建YUM仓库

    YUM主要用于自动安装.升级rpm软件包,它能自动查找并解决rpm包之间的依赖关系. 要成功的使用YUM工具安装更新软件或系统,就需要有一个包含各种rpm软件包的repository(软件仓库),这个 ...

  3. ui-select : There is no "X"(delete button) with selectize theme, when allow-clear="true"

    but add allow-clear="true"For Bootstrap and Select2 themes, it's working perfectly. reason ...

  4. cocos2dx 3.x HttpRequest GET获取数据

    .h文件 #include "network/HttpClient.h" //包含头文件 // GET 函数 void createGetHttp(); void getHttp_ ...

  5. cocostudio 在VS模拟器中加载资源显示混乱问题

    这个是由于cocos2d-x的资源是统一按照文件名管理的,所以游戏全局不能有重名. PS:所有用到的素材名字必须单一.

  6. 裁剪TOGAF进行产品架构开发

    http://ea.zhoujingen.cn/56.html . 有人和我说“周老师,我的企业条件不适合,学习企业架构没用.” 如果等公司让我用企业架构,估计会比我自己开始晚七八年.我们学习任何内容 ...

  7. org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [com.my.service.ProductService] for bean with name 'productService' defi报错解决方法

    原 javaweb项目报错org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [XXX] ...

  8. php中获得数组长度的方法

    php中获得数组长度的方法   count统计数组里元素的个数:  strlen是统计数组中元素的长度: 你如果想统计数组中所有元素的长度,那就用循环统计吧tqeb 代码: $a  =  array( ...

  9. [日志] spring boot + logback 日志输出配置

    一.输出日志到控制台 springboot有很多starter(参考starter)方便快速构建项目依赖组件,logback是springboot默认的日志组件,启动即可看到打印在控制台输出的info ...

  10. VisualStudio下如何编译和使用最新版本的OpenCV(修正版)

    OpenCV是托管于GitHub的开源项目,本文具体解决一个问题,就是“获取最新版本的OpenCV,并且在自己的项目中使用起来"   最新版本 2017年3月31日 BY:jsxyhelu ...