• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
newbie question again about basic Obj C
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: newbie question again about basic Obj C
      • From: Nick Zitzmann <email@hidden>
  • Prev by Date: XCode 3.1.1 Copied Framework != Linked Framework
  • Next by Date: Re: newbie question again about basic Obj C
  • Previous by thread: Re: Xcode 3.1.1 Copied Framework != Linked Framework
  • Next by thread: Re: newbie question again about basic Obj C
  • Index(es):
    • Date
    • Thread