How to convert NSMutableData to NSString on iPhone?
-
09-09-2019 - |
Question
I received an NSMutableData from a server and now I want to convert it to an NSString. Any ideas about how to do this?
Solution
You can use the initWithData:
initializer:
[[NSString alloc] initWithData:data encoding:NSASCIIStringEncoding];
Change the encoding to that of the source data.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow