• 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: Is return value of -readDataOfLength: autoreleased?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Is return value of -readDataOfLength: autoreleased?


  • Subject: Re: Is return value of -readDataOfLength: autoreleased?
  • From: j o a r <email@hidden>
  • Date: Mon, 27 Jun 2005 15:23:48 +0200


On 27 jun 2005, at 15.02, Rick Hoge wrote:

I'm using NSFileHandle's method -readDataOfLength: and am wondering whether the return value is autoreleased.

Why do you care? (I'm not asking that question out of spite, sometimes you do care, but most of the times you don't - or at least shouldn't...).


Rest assured that the general memory management rules apply:

==================================================
A body of code should never be concerned with releasing something it did not create. Therefore, Cocoa sets this policy: If you directly create an object (using alloc, allocWithZone:, or new) or copy an object (using copy, copyWithZone:, mutableCopy, or mutableCopyWithZone:), you are responsible for releasing it. If you did not directly create or copy the object, you do not own it and should not release it.
==================================================


<http://developer.apple.com/documentation/Cocoa/Conceptual/MemoryMgmt/ Concepts/ObjectOwnership.html>

j o a r


Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
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

References: 
 >Is return value of -readDataOfLength: autoreleased? (From: Rick Hoge <email@hidden>)

  • Prev by Date: Re: Not drawing NSTableView rows as selected?
  • Next by Date: Re: Dashboard + RSS
  • Previous by thread: Is return value of -readDataOfLength: autoreleased?
  • Next by thread: Re: Is return value of -readDataOfLength: autoreleased?
  • Index(es):
    • Date
    • Thread