Re: Malloc and NSData
Re: Malloc and NSData
- Subject: Re: Malloc and NSData
- From: The Karl Adam <email@hidden>
- Date: Sun, 19 Dec 2004 20:03:43 -0500
Be sure to remember that it is copied into teh data buffer and that
you are still responsible for releasing the original malloced memory.
-Karl
On Sun, 19 Dec 2004 14:22:29 +0100, Pontus Ilbring
<email@hidden> wrote:
>
> On 2004-12-19, at 13.03, Peter Karlsson wrote:
>
> > Dear list!
> >
> > How do I copy the contents of a buffer (made with malloc) into a NSData
> > object?
>
> If you mean copy into an existing NSData object then the answer is that
> you don't. NSData is immutable.
>
> If you mean create a new NSData object with data from a buffer then try
> initWithBytes:length:
>
> _______________________________________________
> 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
>
>
>
_______________________________________________
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