Instead, convert it to a binary stream ( NSData). It will depend on the format of yours UIImage. If it is JPEG / PNG, for example:
NSData *data1 = UIImageJPEGRepresentation(image, 1.0);
NSData *data2 = UIImagePNGRepresentation(image);
UPDATE: converting binary data to NSStringis a bad idea, so we have a class NSData. The OP wants to be able to send it as a data stream, and then restore it again; NSStringthis will not be required.
source
share