TAILIEUCHUNG - HandBooks Professional Java-C-Scrip-SQL part 113

Tham khảo tài liệu 'handbooks professional java-c-scrip-sql part 113', công nghệ thông tin, kỹ thuật lập trình phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | The isa field of a class object is not inherited from a root class but specified in the declaration of Class in . Its name varies across implementations this handbook uses isa for clarity. isa is the name used in Darwin. This design allows class method invocation and lookup to proceed exactly the same way as for instance methods. Class objects stand on an equal footing with other objects in Objective-C you can assign them to variables declared as id send messages to them and they inherit class methods from their ancestors. The runtime relation between classes and their metaclasses is illustrated in Figure 1-2. Figure 1-2. Classes and their metaclasses Metaclass objects are identical in structure to class objects. However their isa pointers all refer to the root metaclass. This is a practical measure to forestall the need for an infinite hierarchy of meta-metaclasses. Effectively the root class is the meta-metaclass of all its descendants. Since you don t normally use metaclass objects this is not a major blemish on the consistency of Objective-C. The GNU runtime distinguishes between class and metaclass objects more than the Darwin runtime does. In the GNU runtime there are distinct Class and MetaClass types although they are just typedefs for identical structures . Some of the reflection methods like -isKindOf of Obj ect behave differently from the Darwin version when passed metaclass objects. The exact behavior of these methods is described in the Section . Figure 1-2 shows one other distinctive asymmetry in the otherwise uniform structure of the runtime environment the root metaclass s super_class pointer refers to the root class object. This means that class objects behave as if they are instances of their root class class objects will respond not only to their own class messages and those of their parent classes including those of the root but also to instance messages of the root class. Selectors For efficiency method dispatch doesn t look up

Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.