bug-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Documentation Bug?


From: Richard Frith-Macdonald
Subject: Re: Documentation Bug?
Date: Fri, 17 Jun 2005 05:19:25 +0100

On 2005-06-17 05:21:09 +0100 Nicola Pero <n.pero@mi.flashnet.it> wrote:


In
http://gnustep.org/resources/documentation/Developer/Base/ProgrammingManual/manual_4.html#SEC51
it says, for +new, to use...

+ new
{
   Point *point = [[self alloc] init];
     // note "self" refers to the "Point" _class_ object!
   return AUTORELEASE(point);
}

... but NSObject.m says...

+ (id) new
{
   return [[self alloc] init];
}

... which one is right?

NSObject.m is right. +new is supposed to be exactly the same as +alloc followed by -init ... probably a typo in the Base programming manual :-)

I've fixed the programming manual ... worse than just a typo ... wrong on memory management in a few places, with the appearance that the author was wrong/confused in understanding what +new methods do. I don't know how we missed it during proofreading. It could probably do with other people checking it too, as it's obviuously easy to miss these things.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]