RE : RE : a newbie question
RE : RE : a newbie question
- Subject: RE : RE : a newbie question
- From: Etienne Guérard <email@hidden>
- Date: Tue, 11 Nov 2008 15:16:09 -0500
- Thread-topic: RE : a newbie question
Maybe it's an illustrative example, not a real one.
Anyway you'd better stick to NSObject.
Object is used to implement the metaclass class hierachy inside the ObjC runtime.
You normally don't play with it. ;)
EG
-------- Message d'origine--------
De: cocoa-dev-bounces+eguerard=email@hidden de la part de Michael de Haan
Date: mar. 11/11/2008 19:32
À: email@hidden
Objet : Re: RE : a newbie question
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
------------------------------------------------------------
This message and any attachments (the "message") are confidential and intended solely for the addressee(s). Any unauthorised use or dissemination is prohibited. E-mails are susceptible to alteration. Neither DxO Labs nor any of its subsidiaries or affiliates shall be liable for the message if altered, changed or falsified.
Ce message et toutes les pieces jointes (ci-apres le "message") sont confidentiels et etablis a l'intention exclusive de ses destinataires. Toute utilisation ou diffusion non autorisee est interdite. Tout message electronique est susceptible d'alteration. DxO Labs et ses filiales declinent toute responsabilite au titre de ce message s'il a ete altere, modifie ou falsifie.
_______________________________________________
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