Creates a new class and metaclass.
- iOS 2.0+
- macOS 10.5+
- tvOS 9.0+
- watchOS 2.0+
- Mac Catalyst 13.0+Beta
- Objective-C Runtime
The class to use as the new class's superclass, or
Nilto create a new root class.
The string to use as the new class's name. The string will be copied.
The number of bytes to allocate for indexed ivars at the end of the class and metaclass objects. This should usually be
The new class, or
Nil if the class could not be created (for example, the desired name is already in use).
You can get a pointer to the new metaclass by calling
To create a new class, start by calling
objc. Then set the class's attributes with functions like
class. When you are done building the class, call
objc. The new class is now ready for use.
Instance methods and instance variables should be added to the class itself. Class methods should be added to the metaclass.