I have some image data (jpeg) that I want to send from my iPhone application to my web service. To do this, I use NSData from the image and convert it to a string that will be placed in my JSON.
I am currently doing this:
NSString *secondString = [[NSString alloc] initWithBytes:[result bytes] length:[result length] encoding:NSUTF8StringEncoding];
Where is the result of type NSData. However, secondString seems to be null, although the length of the result returns a real value (for example, 14189). I used this method because the result is raw data, not zero completion.
Am I doing something wrong? I used this code in other areas, and it seems to work fine (but the areas in which I am currently using it include data that does not contain images).
TIA.
source share