ios - Unable to write JSONValue into NSDictionary - JSON Framework not working -
I am using JSON to get feedback and then save it to NSDictionary
I am trying. I am using the same code in about 12 clones of the same app and I am doing a great job. But, in one of my apps, I am unable to do this.
NSDictionary * resultDictionary = [jsonString JSONValue]; NSString * statusString = [resultsDictionary objectForKey: @ "status"];
This is a simple two line code and works well in general, but I do not know what is going on at this time. My JSON framework may not work properly. But I'm getting this in JSONValue
:
{"status": "success", "data": [{"userName": "abc@gmail. Com "," first name ":" ABC "," last_name ":" xyz "," gender ":" male "," user id ": 1," membership status ":" active "," saldo ": 499 749, "Avatar": "No_photo.gif", "Unique Code": "abc234abc234", "Register": "abc543abc534", "email": "abc@gmail.com"}]
[___ NSCCC Stenstring Object Foreiki:] : Sent to the unknown selector
Because
the result is empty
Why is
the result data empty? Any remedy?
[jsonString JSONValue]; P>
Apple has created a framework for converting Jason to use these approaches
Use this
NSDictionary * response = [NSJSONSerialization JSONObjectWithData: responseData option: kNilOptions error: & amp; Error];
Comments
Post a Comment