On Sep 30, 2009, at 7:37 PM, Adam R. Maxwell wrote:
Does the Cocoa memory management documentation cover functions? It specifically refers to "...a method whose name begins with...". I wonder if something like the CF "Create" rule applies to Foundation?
No — Foundation functions almost never return references that you need to release. The only exceptions I can think of are a few low-level functions intended to be used for custom object allocation/copying, like NSAllocateObject and NSCopyObject.
The reason for CF's "Create" and "Copy" naming rule is that CF doesn't have autorelease, so functions that might return newly-created objects have no choice but to hand the responsibility to the caller.
—Jens_______________________________________________ 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 arch...@mail-archive.com