1. Find out the size of the class object which received the message
Allocate ((Class)self)->instance_size bytes. In a class method like
this, `self` is the class that received the message. You'll probably
need to #include <objc/objc-runtime.h> to get the definition of
struct objc_class.
2. Initialize the memory with whatever details ObjC needs to know
what kind of object this is
Set newObject->isa = self; (i.e. the class being allocated). Zero out
all other bytes belonging to newObject. That's all the runtime needs,
and all other initialization is handled by whatever -init methods the
class uses.
--
Greg Parker email@hidden Runtime Wrangler
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Objc-language mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/objc-language/email@hidden