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的更多相关文章

  1. IT English Collection(9) of Objective-C

    1 前言 今天我们来解除一篇有关Objective-C的介绍文章,详情如下. 2 详述 2.1 原文 Objective-C defines a small but powerful set of e ...

  2. IT English Collection(20) of Object modeling

    1 前言 本节简单的介绍了对象建模,以及需要注意的事项. 2 详述 2.1 原文 Objectmodeling is the process of designing the objects or c ...

  3. New Concept English Two 16 40

    Keynote Speech  are useful. $课文38  唯独没有考虑到天气 388. My old friend, Harrison, had lived in the Mediterr ...

  4. ActiveMQ学习笔记(16)----Message Dispatch高级特性(二)

    1. Optimized Acknowledgetment ActiveMQ缺省支持批量确认消息,由于批量确认会提高性能,如果希望在应用程序中禁止经过优化的确认方式,可以采用以下几种方式: 1. 在C ...

  5. 使用kubeadm搭建高可用k8s v1.16.3集群

    目录 1.部署环境说明 2.集群架构及部署准备工作 2.1.集群架构说明 2.2.修改hosts及hostname 2.3.其他准备 3.部署keepalived 3.1.安装 3.2.配置 3.3. ...

  6. [Java开发之路](16)学习log4j日志

    1. 新建一个Javaproject.导入Jar包(log4j-1.2.17.jar) Jar包下载地址:点击打开链接 2. 配置文件:创建并设置log4j.properties # 设置 log4j ...

  7. Akka-CQRS(16)- gRPC用JWT进行权限管理

    前面谈过gRPC的SSL/TLS安全机制,发现设置过程比较复杂:比如证书签名:需要服务端.客户端两头都设置等.想想实际上用JWT会更加便捷,而且更安全和功能强大,因为除JWT的加密签名之外还可以把私密 ...

  8. Spring系列16:ApplicationContext扩展国际化

    本文内容 BeanFactory对比ApplicationContext ApplicationContext的扩展能力 国际化 BeanFactory对比ApplicationContext 简单点 ...

  9. ASP.NET Core 1.0中实现文件上传的两种方式(提交表单和采用AJAX)

    Bipin Joshi (http://www.binaryintellect.net/articles/f1cee257-378a-42c1-9f2f-075a3aed1d98.aspx) Uplo ...

随机推荐

  1. AngularJs学习之ng-repeat

    ng-repeat用来遍历一个集合或为集合中的每个元素生成一个模板实例.集合中的每个元素都会被赋予自己的模板和作用域.同时每个模板实例的作用域中都会暴露一些特殊的属性. $index:遍历的进度(0 ...

  2. 项目中用到的input 遇到的问题的归类

    input 前几天 为了这个词 用在搜索框被我们总监喷,为了加强印象,我把它记录下来 最原始的造型 <input type="text" value="搜索&quo ...

  3. HTML5与APP的交互

    phonegap框架,html5直接用于移动开发的框架.现版本UI延迟据说还是略大. App中搞活动,每次都通过mobile api把url给app即可. App操作Html webview.load ...

  4. Ps 美白磨皮【1】

      方法一:去色加图层模式法 打开需要编辑的图片,按Ctrl+J复制新的图层1. 点击菜单栏“图像”-“调整”-“去色”,如下图所示. 将图层面板的混合模式更改为“滤色”,如下图4所示. 最后的显示效 ...

  5. mysql实现增量备份

    有点要注意 如果你误删了表 想通过这个恢复 必须恢复日志里面有创建表的日志 不然的话是无法回复的  就是必须是从你开始创建表的时候就已经记录日志了  恢复到哪个位置 就按照哪个位置来计算 mysql ...

  6. HTML5 canvas文本属性与方法

    文本属性和方法 font                        设置或返回文本内容的当前字体属性 textAlign                设置或返回文本内容的当前对齐方式 start ...

  7. lnmp下安装ffmpeg和ffmpeg-php教程

    现在我将我的过程方法发布出来. 以下都是用SSH命令 一.安装ffmpeg 操作系统:centos6 安装ffmpeg有两种方式:①.用源码包安装,这个不知道怎么回事老是报错②用yum命令安装,cen ...

  8. vim编辑器中撤销和恢复操作

    在VIM编辑器下切换至命令行模式: 撤销: u 恢复: ctrl + r

  9. Struts2请求处理流程及源码分析

    1.1 Struts2请求处理 1. 一个请求在Struts2框架中的处理步骤: a) 客户端初始化一个指向Servlet容器的请求: b) 根据Web.xml配置,请求首先经过ActionConte ...

  10. C#7.0

    C#7.0中有哪些新特性? 以下将是 C# 7.0 中所有计划的语言特性的描述.随着 Visual Studio “15” Preview 4 版本的发布,这些特性中的大部分将活跃起来.现在是时候来展 ...