On Mon, Dec 1, 2008 at 11:04 PM, Stephen J. Butler
<[EMAIL PROTECTED]> 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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to