• 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: Do I "own" objects returned to me by reference?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Do I "own" objects returned to me by reference?


  • Subject: Re: Do I "own" objects returned to me by reference?
  • From: "Adam R. Maxwell" <email@hidden>
  • Date: Fri, 5 May 2006 21:39:36 -0700


On May 5, 2006, at 20:16, Jim Correia wrote:

On May 5, 2006, at 11:05 PM, Adam R. Maxwell wrote:

I ran across at least one exception to this, relevant to the OP's question: +[NSPropertyListSerialization dataFromPropertyList:format:errorDescription:] returns an error string by reference, and in that case, you are responsible for releasing the string. This is explicitly stated in the documentation, but isn't obvious from the method signature.

Thank goodness the behavior is documented, and the resulting leak (if you assume that it works like the rest of Cocoa) should be small and in frequent.


But that it is a documented exception doesn't make it any more correct :-)

Oh, I agree on both counts; my implied point was that exceptions like this seem to be documented explicitly.


rdar://3068938

Hopefully they don't returning an autoreleased string, or those of use who read the documentation will be in trouble :).


--
Adam


_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: Do I "own" objects returned to me by reference?
      • From: Ondra Cada <email@hidden>
References: 
 >Do I "own" objects returned to me by reference? (From: Jerry Krinock <email@hidden>)
 >Re: Do I "own" objects returned to me by reference? (From: Shawn Erickson <email@hidden>)
 >Re: Do I "own" objects returned to me by reference? (From: "Adam R. Maxwell" <email@hidden>)
 >Re: Do I "own" objects returned to me by reference? (From: Jim Correia <email@hidden>)

  • Prev by Date: Re: How to control the commit of text edit field with binding?
  • Next by Date: Re: Expanding a window and adding controlls dynammicaly.
  • Previous by thread: Re: Do I "own" objects returned to me by reference?
  • Next by thread: Re: Do I "own" objects returned to me by reference?
  • Index(es):
    • Date
    • Thread