Function 関数

objc_constructInstance

Creates an instance of a class at the specified location.

Declaration 宣言

id objc_constructInstance(Class cls, void *bytes);

Parameters パラメータ

cls

The class that you want to allocate an instance of.

bytes

The location at which to allocate an instance of the cls class. bytes must point to at least class_getInstanceSize(cls) bytes of well-aligned, zero-filled memory.

Return Value 戻り値

An instance of the class cls at bytes, if successful; otherwise nil (for example, if cls or bytes are themselves nil).

See Also 参照

Instantiating Classes