Re: NSData question
Re: NSData question
- Subject: Re: NSData question
- From: Jim Correia <email@hidden>
- Date: Tue, 16 Apr 2002 08:53:52 -0400
On Tuesday, April 16, 2002, at 02:45 AM, Ondra Cada wrote:
On Tuesday, April 16, 2002, at 04:30 , Jonathan Wight wrote:
Anyone know if an NSData object created with:
+ (id)dataWithBytesNoCopy:(void *)bytes length:(unsigned)length;
will try to free 'bytes' when it gets dealloc-ed?
Yup, it will (as documented).
Alas there is no way to prevent that (as there is with the similar method
of NSString). Perhaps we should fill a feature request to extend the API
somewhat?
Meanwhile, CFData (which is toll-free bridged with NSData) supports the
feature you need, so you can either just make the appropriate calls
yourself, or add a category on NSData for convenience.
<
http://developer.apple.com/techpubs/macosx/Cocoa/TasksAndConcepts/ProgrammingTopics/
BinaryData/Tasks/WorkingWithBinaryData.html>
Jim
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.