On Thu, Mar 20, 2008 at 1:42 AM, Chris Suter <[EMAIL PROTECTED]> wrote:

>  I suspect that it will just end up getting documented as behaving this
>  way and that's fair enough, I thinkā€”it is NSMutableData after all.

Turns out it's already documented
(http://developer.apple.com/documentation/Cocoa/Conceptual/BinaryData/Tasks/WorkingBinaryData.html):

"However, if you create an NSData object with one of the methods whose
name includes NoCopy (such as dataWithBytesNoCopy:length:), the bytes
are not copied. Instead, the data object takes ownership of the bytes
passed in as an argument and frees them when the object is released.
(NSMutableData responds to these methods, too, but the bytes are
copied anyway and the buffer is freed immediately.) For this reason,
the bytes you pass to the NoCopy methods must have been allocated
using malloc."

Hamish
_______________________________________________

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 [EMAIL PROTECTED]

Reply via email to