• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Releasing NSSearchPathForDirectoriesInDomain causes crash
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Releasing NSSearchPathForDirectoriesInDomain causes crash


  • Subject: Re: Releasing NSSearchPathForDirectoriesInDomain causes crash
  • From: Jens Alfke <email@hidden>
  • Date: Thu, 1 Oct 2009 08:42:35 -0700


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 (email@hidden)

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:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Releasing NSSearchPathForDirectoriesInDomain causes crash
      • From: "Adam R. Maxwell" <email@hidden>
  • Prev by Date: Re: Deleting CalTasks through an Array.
  • Next by Date: [Enigmatic semi-solution] Re: Cannot get pixel color from NSBitmapImageRep
  • Previous by thread: Re: NSDocumentController didCloseAllSelector
  • Next by thread: Re: Releasing NSSearchPathForDirectoriesInDomain causes crash
  • Index(es):
    • Date
    • Thread