• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Malloc and NSData
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Malloc and NSData


  • Subject: Re: Malloc and NSData
  • From: 陳銘崧 a.k.a. James Chen <email@hidden>
  • Date: Sun, 19 Dec 2004 21:03:29 +0800

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@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
References: 
 >Malloc and NSData (From: "Peter Karlsson" <email@hidden>)

  • Prev by Date: Malloc and NSData
  • Next by Date: Re: Malloc and NSData
  • Previous by thread: Malloc and NSData
  • Next by thread: Re: Malloc and NSData
  • Index(es):
    • Date
    • Thread