I know that this was asked a long time ago, and I have already followed several approaches, but they do not work.
Here is what I have already tried:
NSString *newStr = [NSString stringWithUTF8String:[responseData bytes]]; NSString *newStr = [NSString stringWithFormat:@"%.*s", [responseData length], [responseData bytes]];
None of them work. In the first case, it fills newStr with a null value. In the 2nd, it is filled with unnecessary characters. I know from the debugger log (po responseData) that I am getting a valid response that looks like bbbbbb 00 bbbbbb. [server sends them as an array of bytes]
What to do?
EDIT: I get this data from an HTTP request response - using the ASIHTTPRequest library, in case someone can help on this line.
source share