문제

In Objective-C, when are the class pairs - metaclass object and class object, created? Is it in the beginning of the app execution or at the point when you first instantiate the first object of a class?

도움이 되었습니까?

해결책

At the point that the class is added to the class hierarchy. This is generally when the app is launched, but could be later if the class is added by a dynamically loaded library or is created programatically.

The class object and metaclass have to exist at the time that +load is called (which is the above).

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top