IT English Collection(16) of Message
来源:互联网 发布:js文本框失去焦点时 编辑:程序博客网 时间:2024/06/05 13:28
1 前言
本文介绍了关于Objective-C中的消息机制,详情如下。
转载请注明出处:http://blog.csdn.net/developer_zhang
2 详述
2.1 原文
A message is the name of a method, and any parametersassociated with it, that are sent to, andexecuted by, an object. To get an object to do something, you send it a message telling it to apply a method. In Objective-C, youspecify the object (known as the receiver of the method) and the message being sent to that object byenclosing the messageexpression inbrackets. For example, this message expression tells the myRectangle
object to perform its display
method:
[myRectangle display];
(The expression is followed by asemicolon (;
) 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’srepertoire 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 acolon (:
) to the selector name and puts the parameter right after the colon. Thisconstruct 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. 全部节目;计算机指令系统
affixesn. [语] 词缀
colon['kəʊlən] n. 冒号
construct[kən'strʌkt] vt. 建造,构造
3 结语
以上是所有内容,希望对大家有所帮助。
- IT English Collection(16) of Message
- IT English Collection(27)of Collection
- IT English Collection(9) of Objective-C
- IT English Collection(10) of Object encoding
- IT English Collection(12) of Archiving
- IT English Collection(13) of Nib file
- IT English Collection(14) of Storyboard
- IT English Collection(15)of Outlet
- IT English Collection(17) of Selector
- IT English Collection(18)of Target-Action
- IT English Collection(19)of View object
- IT English Collection(20) of Object modeling
- IT English Collection (25) of Responder object
- IT English Collection(26) of Undo manager
- IT English Collection(29)of Preferences
- IT English Collection(30) of Animation
- Before IT English Collection
- IT English Collection(1)of Event(IOS)
- iOS7的21个小技巧 土豪不止需要iPhone 5S
- 关于“无法解析的外部符号”和“该符号在函数_wmain 中被引用”的问题
- java date()函数与现实时间不匹配 解决
- 2014华为招聘机试第三题
- AspCms2标签大全
- IT English Collection(16) of Message
- Rose出现 “relation from A to B would cause an Invalid circular inheritance"解决方法。
- GNU
- centOS安装scst遇到的问题
- myeclipse快捷键收集整理
- Java中CallableStatement调用Oracle存储过程总结
- 第八章
- jquery mobile 的4个初始化事件
- linux--crontab