Re: RE : a newbie question
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