Textual representation of an NSData?
Textual representation of an NSData?
- Subject: Textual representation of an NSData?
- From: Dave DeLong <email@hidden>
- Date: Mon, 01 Dec 2008 20:46:54 -0700
Hey everyone,
I've got some NSData objects that I'd like to hard code into a file
(they're encoded images for some example factory methods). The reason
I need to hard code them is that I need to be able to reconstruct
these images on both the Mac and the iPhone, and I thought that
getting the TIFFRepresentation of the 32x32 version and then some how
hard coding it into my factory class would be "simplest".
If possible, I'd like to avoid compiling in image files, because in
the future I'm planning on being able to accept any image encoded into
an NSData (ones that won't be hard coded), and I'd like to have the
built-in presets follow the same format.
I've written a little app to take the bytes of an NSData and convert
them into a hexadecimal string, using the code found here: http://www.cocoabuilder.com/archive/message/cocoa/2007/11/29/194188
, but I'm at a bit of a loss on how to reconstruct the NSData from
the hex string.
Any thoughts?
Thanks,
Dave
_______________________________________________
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