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

In Objective-C, when are pairs of classes created - a metaclass object and a class object? Is this at the beginning of the application or the moment you first instantiate the first object of the class?

+7
objective-c objective-c-runtime
source share
1 answer

The moment a class is added to the class hierarchy. This usually happens when the application starts, but it can be later if the class is added by a dynamically loaded library or created programmatically.

The class object and metaclass must exist at the time of the call +load (which is the one indicated above).

+6
source share

All Articles