Re: Textual representation of an NSData?
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