Re: Newbie memory question
Re: Newbie memory question
- Subject: Re: Newbie memory question
- From: Nick Zitzmann <email@hidden>
- Date: Wed, 9 May 2007 14:17:55 -0600
On May 9, 2007, at 2:08 PM, email@hidden wrote:
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 suggest you do something like this: (warning - written in Mail,
untested, use at your own risk, etc.)
NSData *data = [NSData dataWithContentsOfFile:@"/testData"];
SomeFunction([testData bytes], [testData length]);
I got that simply by glancing at the NSData documentation.
NSKeyedUnarchiver is for unarchiving data that was previously
archived using NSKeyedArchiver and isn't a general-purpose data-
loading object.
Nick Zitzmann
<http://www.chronosnet.com/>
_______________________________________________
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