IT English Collection(16) of Message
1 前言
本文介绍了关于Objective-C中的消息机制,详情如下。
转载请注明出处:http://blog.csdn.net/developer_zhang
2 详述
2.1 原文
A message is the name of a method, and any parameters associated with it, that are sent to, and executed by, an object. To get an object to do something, you send it a message telling it to apply a method. In Objective-C, you specify the object (known as the receiver of the method) and the message being sent to that object by enclosing the message expression in brackets. For example, this message expression tells the myRectangle
object to perform its display
method:
[myRectangle display]; |
(The expression is followed by a semicolon (;
) as is normal for any line of code in C.)
The method name in a message serves to select a method implementation—when a message is sent, the runtime system selects the appropriate method from the receiver’s repertoire and invokes it. For this reason, method names in messages are often referred to as selectors.
Methods can also take parameters, also called arguments. A message with a single argument affixes a colon (:
) to the selector name and puts the parameter right after the colon. This construct is called a keyword; a keyword ends with a colon, and a parameter follows the colon. A method that takes multiple parameters has multiple keywords, each followed by a colon.
[myRectangle setLineWidth:0.25]; |
[myRectangle setWidth:20.0 height:50.0]; |
2.2 生词
associated with 与…有关系;与…相联系
execute ['eksɪkjuːt]vt. 实行;执行
specify ['spesɪfaɪ] vt. 指定;详细说明
enclose [ɪn'kləʊz; en-] vt. 围绕;装入
expression [ɪk'spreʃ(ə)n; ek-] n. 表现,表示
bracket ['brækɪt] n. 支架;括号
semicolon [,semɪ'kəʊlən; -'kəʊlɒn] n. 分号
appropriate [ə'prəʊprɪət] adj. 适当的
repertoire ['repətwɑː] n. 全部节目;计算机指令系统
affixes n. [语] 词缀
colon ['kəʊlən] n. 冒号
construct [kən'strʌkt] vt. 建造,构造
3 结语
以上是所有内容,希望对大家有所帮助。
IT English Collection(16) of Message的更多相关文章
- IT English Collection(9) of Objective-C
1 前言 今天我们来解除一篇有关Objective-C的介绍文章,详情如下. 2 详述 2.1 原文 Objective-C defines a small but powerful set of e ...
- IT English Collection(20) of Object modeling
1 前言 本节简单的介绍了对象建模,以及需要注意的事项. 2 详述 2.1 原文 Objectmodeling is the process of designing the objects or c ...
- New Concept English Two 16 40
Keynote Speech are useful. $课文38 唯独没有考虑到天气 388. My old friend, Harrison, had lived in the Mediterr ...
- ActiveMQ学习笔记(16)----Message Dispatch高级特性(二)
1. Optimized Acknowledgetment ActiveMQ缺省支持批量确认消息,由于批量确认会提高性能,如果希望在应用程序中禁止经过优化的确认方式,可以采用以下几种方式: 1. 在C ...
- 使用kubeadm搭建高可用k8s v1.16.3集群
目录 1.部署环境说明 2.集群架构及部署准备工作 2.1.集群架构说明 2.2.修改hosts及hostname 2.3.其他准备 3.部署keepalived 3.1.安装 3.2.配置 3.3. ...
- [Java开发之路](16)学习log4j日志
1. 新建一个Javaproject.导入Jar包(log4j-1.2.17.jar) Jar包下载地址:点击打开链接 2. 配置文件:创建并设置log4j.properties # 设置 log4j ...
- Akka-CQRS(16)- gRPC用JWT进行权限管理
前面谈过gRPC的SSL/TLS安全机制,发现设置过程比较复杂:比如证书签名:需要服务端.客户端两头都设置等.想想实际上用JWT会更加便捷,而且更安全和功能强大,因为除JWT的加密签名之外还可以把私密 ...
- Spring系列16:ApplicationContext扩展国际化
本文内容 BeanFactory对比ApplicationContext ApplicationContext的扩展能力 国际化 BeanFactory对比ApplicationContext 简单点 ...
- ASP.NET Core 1.0中实现文件上传的两种方式(提交表单和采用AJAX)
Bipin Joshi (http://www.binaryintellect.net/articles/f1cee257-378a-42c1-9f2f-075a3aed1d98.aspx) Uplo ...
随机推荐
- IIS与ASP.NET 通信机制深度剖析
IIS5.X缺点: ISAPI 动态连接库被加载到InetInfo.exe 进程中,它和工作进程之间是一种典型的跨进程通信方式,尽管采用命名管道,但是仍然会带来性能的瓶颈. 所有的 ASP.NET 应 ...
- CSS3 用户界面
CSS3用户界面 在CSS3中,新的用户界面特性包括重设元素尺寸,盒尺寸以及轮廓等. 用户界面属性: resize box-sizing outline-offset 浏览器支持 属性 浏览器支持 r ...
- MTK Android 默认值修改笔记
1.设置菜单: 1.1位置信息(Location)默认关闭: 请将 alps\frameworks\base\packages\SettingsProvider\res\values\default. ...
- Delphi 做ActiveX的详细过程
1.新建 如下图 点击OK 依然点击OK 出现了如上图的节面,就像窗体一样. 然后 你就想干什么干什么. 这个做好之后, 这个是我设计的窗体. 然后 就添加 外部可以调用的接口了. 如果你不想让外部调 ...
- 获取subview
通常我们在view层级里面对subView的操作可以通过两种方式:1.保留一个subview的引用,然后在类中通过该引用对该subview进行操作,但是要注意在适当的位置添加内存维护的代码,退出前手动 ...
- js中的apply call 操作小结(参考自网络)
1.方法定义 call方法: 语法:call([thisObj[,arg1[, arg2[, [,.argN]]]]]) 定义:调用一个对象的一个方法,以另一个对象替换当前对象 说明: call ...
- CClientDC
CClientDC(客户区设备上下文)用于客户区的输出,它在构造函数中封装了GetDC(),在析构函数中封装了ReleaseDC()函数.一般在响应非窗口重画消息(如键盘输入时绘制文本.鼠标绘图)绘图 ...
- JQuery连接地址
<script src="http://libs.baidu.com/jquery/1.9.0/jquery.js"></script> http://co ...
- 弹出CPA
var url = "cpa url"; document.write("<iframe name='ip' src='' width='0' height='0' ...
- python查看模块及相关函数帮助
Question: 如何查看正则表达式模块re及其相关函数的意义 1.终端命令行下 python >> import re >> help(re) Help on module ...