newbie question again about basic Obj C
newbie question again about basic Obj C
- Subject: newbie question again about basic Obj C
- From: Michael <email@hidden>
- Date: Wed, 5 Nov 2008 18:33:44 -0800
May I just ask a very basic question. Here is a quote from one of the Obj C tutorials.
<<<<<<<
"For example, to create a new instance of "Object" we would use... [Object alloc]; "alloc" being a class method which allocates memory for the new object. This does not make the object useful because none of its instance variables were initialized...to do that we call "init"...so, the whole thing would go.... id object = [Object alloc];
[object init];
>>>>>>>
Now, I understand that alloc returns a pointer to the memory that is allocated to the new object. But, what exactly does "init" do. For example, does init divide the allocated memory to specific areas that represent the instance variables...or is it even more basic that it provides addresses for those variables? Thanks in advance. |
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden