-
Cocoa 教程 第一讲 Objective C 语法(一) - [苹果 Cocoa 编程技术]
版权声明:转载时请以超链接形式标明文章原始出处和作者信息及本声明
元旦后更新
http://51test2003.blogbus.com/logs/7950208.html
历史上的今天:
苹果 POSIX 信号量 2007-08-27麦克孤独本地化组织现在报名 2007-08-27Cocoa 教程 篇外语 Objective C 与 C 、C++ 的关系及调用实现 2007-08-27随机文章:
Xcode 单元测试介绍 (Objective C 篇) 2008-12-24超链接样式的按钮 (NSButton 扩展<光标与富文本>) 2008-12-27Xcode 单元测试介绍 (C/C++ 篇) 2008-12-24Xcode 环境下的汇编与 C/C++/ObjC (下) 2008-12-23Xcode 环境下的汇编与 C/C++/ObjC (上) 2008-12-23
收藏到:Del.icio.us
评论
In general, methods in different classes that have the same selector (the same name) must also share the
same return and argument types. This constraint is imposed by the compiler to allow dynamic binding.
Because the class of a message receiver (and therefore class-specific details about the method it’s asked to
perform), can’t be known at compile time, the compiler must treat all methods with the same name alike.
When it prepares information on method return and argument types for the runtime system, it creates just
one method description for each method selector.
However, when a message is sent to a statically typed object, the class of the receiver is known by the
compiler. The compiler has access to class-specific information about the methods. Therefore, the message
is freed from the restrictions on its return and argument types