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: [EMAIL PROTECTED] de la part de Michael de Haan Date: mar. 11/11/2008 19:32 À: cocoa-dev@lists.apple.com 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 (Cocoa-dev@lists.apple.com) 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: http://lists.apple.com/mailman/options/cocoa-dev/eguerard%40dxo.com This email sent to [EMAIL PROTECTED] ------------------------------------------------------------ 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 (Cocoa-dev@lists.apple.com) 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]