JSON: Understanding format in Objective-C -
Looking at the following JSON payload I would like to remove "023" from key "23":
JSON Payload: {{"keyA": {"Loan": 139, "Late": 35}, "Kby": [{"Key 1": "Value", "Key 2": "023"}}}
This is the code I'm going to apply:
NSDictionary * subResults = jsonResult [@ "keyB"]; NSLog (@ "VALUE:% @", [Subtitle value forek: @ "key2"]) Although the value is printed as:
< Code> VALUE: (023)
I have to get rid of the bracket "(". I'm coming to the wrong way of extraction? "
Again, it's okay. Now, you have a son object here, which includes 2 keys (A and B). And Kib is connected to Jason Array which means:
jsonResult [@ "keyB"];
An NSDictionnary does not return, but an NSArray, Now if you try to get the value of "023" then you should
NSString str = jsonResult [@ "keyB"] [0] [@ "key2" "]; // Return" 023 "
and perhaps
int twenty-t-v = str.intValue;
Comments
Post a Comment