Skip navigation.
 
mlRe: Malloc and NSData
FROM : ??? a.k.a. James Chen
DATE : Sun Dec 19 14:03:29 2004

Hi,
You could send -bytes to NSData to access the start position of that
NSData's contents.
So you copy your data to the address refer to the returned value.

Ex:
memcpy((void *)[NSData bytes], src, data_size);

HTH,
James

------------------------------------
Ulead Systems Inc.
James Chen
Software Engineer
Image Div.
------------------------------------
On Dec 19, 2004, at 8:03 PM, Peter Karlsson wrote:

> Dear list!
>
> How do I copy the contents of a buffer (made with malloc) into a NSData
> object?
>
> Best regards Peter
>
>  _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Cocoa-dev mailing list      (<email_removed>)
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/<email_removed>
>
> This email sent to <email_removed>
>

Related mailsAuthorDate
mlMalloc and NSData Peter Karlsson Dec 19, 13:03
mlRe: Malloc and NSData ??? a.k.a. James C… Dec 19, 14:03
mlRe: Malloc and NSData Pontus Ilbring Dec 19, 14:22
mlRe: Malloc and NSData The Karl Adam Dec 20, 02:03
mlRe: Malloc and NSData Clark Cox Dec 20, 03:40