isa pointer in objective-c

前端 未结 4 1867
感动是毒
感动是毒 2021-02-02 14:20

From this reference:

When a new object is created, memory for it is allocated, and its instance variables are initialized. First among the object’s vari

4条回答
  •  不思量自难忘°
    2021-02-02 14:48

    On 64-bit environment, an object’s ISA field shouldn’t be accessed. The ISA field no longer holds a pointer. It includes some pointer data and uses the remaining bits to hold other runtime information. CLASS property or OBJECT_GETCLASS function can be used to read an isa field. OBJECT_SETCLASS can be used to write an isa field.

    Ref: https://developer.apple.com/library/ios/documentation/General/Conceptual/CocoaTouch64BitGuide/ConvertingYourAppto64-Bit/ConvertingYourAppto64-Bit.html#//apple_ref/doc/uid/TP40013501-CH3-SW1

提交回复
热议问题