Property

Property include getter and setter;

you can  get property like this:

Object.someProperty;

or

[Object someProperty];

Inheritance

overriding methods

when you override a method, you can only change its implementation.

Youcannot change how it is declared; the method's name ,return type , 

and argument types must stay the same;

Inheritance hierarchy

NSObject has many methods but only one instance variable: the isa pointer.

Every object's isa pointer points at the class that created it. (Get it ? When 

you have a BNRPerson instance , that object "is a" BNRPerson.

When you have an NSString instance, that object "is a [n]" NSString.)


The first implementation that is found is t


he one that gets executed..

description and %@

The token %@ use to get an object to describe itself .The %@ token sends a descroption

message to the object pointed to by the corresponding variable.


NSObeject has many methods but only one instance variable: the isa pointer.Every object's isa pointer points at the class that created it.(Get it ? When you have a BNRPerson instance , that object "is a" BNRPerson. When you have an NSString instance , that object "is a[n]" NSString.)

The descroption method returns a string that is a useful description of an instance of the class . It is an NSObject method,so evety object implements it.The default NSObject implementation returns the object's address in memory as string.

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容