Re: Newbie memory question
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