I'm working on a class that I think would benefit from a convenience method, the same way that NSNumber, NSString and NSArray have for creating the object. Can't figure out how. The only thing I can find from a google search is someone suggesting that you call the init method with an autorelease. Like so:
Is this really the best way to do it?
Code:
+ stringWithFoo: (Foo *) aFoo
{
return [[[self alloc] initWithFoo: aFoo] autorelease];
}
Is this really the best way to do it?