Question

I can get the value in JSON format with the function:

NSMutableArray *jsonArrayClass = [NSJSONSerialization JSONObjectWithData:data
                                                     options:kNilOptions
                                                       error:&error];

But i really have no idea how to get the string value or boolean value. we have some validation will return this data type. not JSON.

The raw value shown on Flidder looks like (ID00001 is the return string):

HTTP/1.1 200 OK
Cache-Control: no-cache
Pragma: no-cache
Content-Type: application/json; charset=utf-8
Expires: -1
Server: Microsoft-IIS/7.5
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
Date: Mon, 07 Apr 2014 17:15:28 GMT
Content-Length: 9

"ID00001"
Was it helpful?

Solution

Try this

[[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top