Re: Newbie memory question
Re: Newbie memory question
- Subject: Re: Newbie memory question
- From: "Sean McBride" <email@hidden>
- Date: Wed, 9 May 2007 16:14:01 -0400
- Organization: Rogue Research
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