博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
面向对象的几个概念
阅读量:6449 次
发布时间:2019-06-23

本文共 1898 字,大约阅读时间需要 6 分钟。

■ A class is a structure that represents an object’s type. An object refers to its class to

get various information about itself, particularly what code to run to handle each
action. Simple programs might have a handful of classes; moderately complex ones
will have a couple of dozen. Objective- C style encourages developers to capitalize
class names.
■ An object is structure containing values and a hidden pointer to its class. Running
programs typically have hundreds or thousands of objects. Objective- C variables that
refer to objects are typically not capitalized.
■ Instance is another word for “object.” For example, a circle object can also be
called an instance of class Circle.
■ A message is an action that an object can perform. This is what you send to an object
to tell it to do something. In the [shape draw] code, the draw message is sent to the
shape object to tell it to draw itself. When an object receives a message, its class is
consulted to find the proper code to run.
■ A method is code that runs in response to a message. A message, such as draw, can
invoke different methods depending on the class of the object.
■ The method dispatcher is the mechanism used by Objective- C to divine which method
will be executed in response to a particular message. We’ll get out our shovels and dig
a lot more into the Objective- C method dispatch mechanism in the next chapter.

 

另外适用于object-c的:

The interface is the description of the features provided by a class of objects. For

example, the interface for class Circle declares that circles can accept the draw
message.

The implementation is the code that makes the interface work. In our examples,

the implementation for the circle object holds the code for drawing a circle on the
screen. When you send the draw message to a circle object, you don’t know or care
how the function works, just that it draws a circle on the screen.

转载地址:http://imowo.baihongyu.com/

你可能感兴趣的文章
在微博微信看不到真诚?这些社交应用让你不用再装
查看>>
82%的IT专业人员认为Windows 10会让他们的公司更安全
查看>>
与美女CEO罗元裳共进午餐!朋友圈被7分钟理财刷屏!
查看>>
卡巴斯基网络安全解决方案实现自动化
查看>>
皮尤:62%美国成人从社交网站获取新闻
查看>>
Windows 10 Mobile内部编译版本已移除Silverlight支持
查看>>
“对外”SaaS蓝海:移动CRM最吸金
查看>>
反倾销半年涉案85亿 光伏出口或受影响
查看>>
图尔克推行户RFID设备控制器TBEN-L-DCC,可进行数据控制
查看>>
有了大数据的介入 以后考试可能都没法作弊了
查看>>
数据中心服务器虚拟化技术介绍
查看>>
要想做好软件测试工作,就要学会思考并问为什么
查看>>
qa应掌握的技能
查看>>
三部委:鼓励光伏项目进口先进技术和产品
查看>>
新进入者布局移动互联网形成有力挑战
查看>>
AOI 2016年第三季度数据中心光模块营收同增37%
查看>>
交换机引领多媒体时代 东进颠覆传统CTI
查看>>
三选一 软件定义存储技术总有一款适合你
查看>>
支付宝不做社交用户猛涨!第一季度日活大增40%
查看>>
Oracle单行函数和多行函数实例
查看>>