bug-gnustep
[Top][All Lists]
Advanced

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

Re: Documentation Bug?


From: Nicola Pero
Subject: Re: Documentation Bug?
Date: Fri, 17 Jun 2005 05:21:09 +0100 (BST)


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 :-)

Thanks



reply via email to

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