Re: Is return value of -readDataOfLength: autoreleased?
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