On Mon, Jun 22, 2009 at 12:02 PM, Chunk 1978<[email protected]> wrote:
> "new", "alloc", initWithFormat" (or "stringWithFormat") are class
> factory methods that are declared methods inherited by my custom
> classes, i guess somewhere in NSObject?

No.  +alloc is a class method that creates a new instance.
-initWithFormat: is an initializer.  +new is a shortcut for saying
[[Foo alloc] init].  +stringWithFormat: is a convenience constructor
that returns an unowned reference, and is therefore similar to doing
[[[NSString alloc] initWithFormat:...] autorelease].

Please review the conceptual documentation, particularly the
introduction to Objective-C and the Memory Management Guide.

--Kyle Sluder
_______________________________________________

Cocoa-dev mailing list ([email protected])

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]

Reply via email to