• 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: Newbie memory question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Newbie memory question


  • Subject: Re: Newbie memory question
  • From: email@hidden
  • Date: Wed, 9 May 2007 22:18:01 +0200

Thank you!

On 5/9/07, Sean McBride <email@hidden> wrote:
On 2007-05-09 22:08, email@hidden said:

>I have some data. I now need a generic pointer to the memory holding
>the data, as well as the size of that memory block, in order to pass
>the data to a function. How can I do this? I tried this to no avail:
>
>NSData *testData = [NSKeyedUnarchiver unarchiveObjectWithFile:@"/testData"];
>
>void *pointer = malloc(sizeof(testData));
>pointer = [testData copy];
>UInt32 size = (sizeof(pointer));

const void* pointer = [testData bytes];
unsigned size = [testData length];

This is pretty clear in the NSData docs....

--
____________________________________________________________
Sean McBride, B. Eng                 email@hidden
Rogue Research                        www.rogue-research.com
Mac Software Developer              Montréal, Québec, Canada



_______________________________________________

Cocoa-dev mailing list (email@hidden)

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:
This email sent to email@hidden


References: 
 >Newbie memory question (From: email@hidden)
 >Re: Newbie memory question (From: "Sean McBride" <email@hidden>)

  • Prev by Date: Re: Newbie memory question
  • Next by Date: Re: Newbie memory question
  • Previous by thread: Re: Newbie memory question
  • Next by thread: Re: Newbie memory question
  • Index(es):
    • Date
    • Thread