Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In Objective-C, when are metaclass object and class object created?

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?

like image 301
Boon Avatar asked Dec 02 '13 17:12

Boon


1 Answers

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).

like image 114
Rob Napier Avatar answered Nov 15 '22 20:11

Rob Napier