Property

作者: _AHINO | 来源:发表于2017-08-08 22:56 被阅读0次

    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.

    相关文章

      网友评论

          本文标题:Property

          本文链接:https://www.haomeiwen.com/subject/susxrxtx.html