• 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: 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


References: 
 >Newbie memory question (From: email@hidden)

  • Prev by Date: Re: Newbie memory question
  • Next by Date: Re: World Builder Type Application
  • Previous by thread: Re: Newbie memory question
  • Next by thread: Object Scope
  • Index(es):
    • Date
    • Thread