• 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: Textual representation of an NSData?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Textual representation of an NSData?


  • Subject: Re: Textual representation of an NSData?
  • From: "Michael Ash" <email@hidden>
  • Date: Tue, 2 Dec 2008 00:02:01 -0500

On Mon, Dec 1, 2008 at 11:04 PM, Stephen J. Butler
<email@hidden> wrote:
> Really, don't encode it in your binary. Especially bad idea on an
> embedded platform like the iPhone because they you're carrying around
> the image data in memory whether you're currently using the image or
> not. It's dead weight.

I would have thought that the iPhone would memory map application
binaries just like its big brother does, which will end up using zero
memory if the data isn't being actively used. Is that not the case?

For embedding data in a binary, the 'xxd -i' command will spit out a
nice C header file declaring a bytes and length variable. It's trivial
to incorporate that command as part of your Xcode build process using
a shell script build phase, so that you can keep the file separate in
your project but build it directly into the binary at compile time.

Most of the time I'd agree that you should just keep the data in a
separate file, but sometimes it can be useful to bake the stuff right
into the code.

Mike
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please 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

  • Follow-Ups:
    • Re: Textual representation of an NSData?
      • From: "Stephen J. Butler" <email@hidden>
References: 
 >Textual representation of an NSData? (From: Dave DeLong <email@hidden>)
 >Re: Textual representation of an NSData? (From: "Stephen J. Butler" <email@hidden>)

  • Prev by Date: Re: Crash when closing window from the menu
  • Next by Date: Re: Create command from string
  • Previous by thread: Re: Textual representation of an NSData?
  • Next by thread: Re: Textual representation of an NSData?
  • Index(es):
    • Date
    • Thread