• 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
Re: RE : a newbie question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: RE : a newbie question


  • Subject: Re: RE : a newbie question
  • From: Michael de Haan <email@hidden>
  • Date: Tue, 11 Nov 2008 10:32:46 -0800


On Nov 11, 2008, at 9:21 AM, Etienne Guérard wrote:

You should derive your classes from NSObject, not from Object.
You normally don't have to #include <objc/Object.h>.
Where did you find such an example?


It is from Steve Kochan's book ...which is basically an introduction to Objective C.




The alloc method basically does a calloc of the appropriate instance size.
The init method of NSObject does nothing.
It's good practive to always call an init metod in your own constructor and when you create a new object.
So all you have to do is this:


Fraction *myFraction = [[Fraction alloc] init];

Don't forget to (auto)release this object when you're done.





Thank you._______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • RE : RE : a newbie question
      • From: Etienne Guérard <email@hidden>
References: 
 >a newbie question (From: Michael <email@hidden>)
 >RE : a newbie question (From: Etienne Guérard <email@hidden>)

  • Prev by Date: Re: Play/Pause, rew/ff keys ...
  • Next by Date: another n00b question -- addObserver weirdness
  • Previous by thread: RE : a newbie question
  • Next by thread: RE : RE : a newbie question
  • Index(es):
    • Date
    • Thread