Home > Mobile >  NSDictionary solution not to come out
NSDictionary solution not to come out

Time:09-19

NSDictionary
Solve
{
HeWeather6=(
{
Basic={
"Admin_area"="\ U4e0a \ U6d77";
Cid=CN101020100;
Cnty="\ U4e2d \ U56fd";
Lat="31.23170662";
Location="\ U4e0a \ U6d77";
Lon="121.47264099";
"Parent_city"="\ U4e0a \ U6d77";
Tz="+ 8.00";
};
Now={
Cloud=0;
"Cond_code=100;"
"Cond_txt"="\ U6674";
Fl=12;
Hum=36;
PCPN="0.0";
Pres=1025;
TMP=14;
Vis=16;
"Wind_deg=289;"
"Wind_dir"="\ U897f \ U5317 \ U98ce";
"Wind_sc"=1;
"Wind_spd"=5;
};
The status=ok;
The update={

Loc="2020-02-23 and desired";
Utc="2020-02-23 long";
};
}
);
}

CodePudding user response:

The code of a see be is not in conformity with the json string, so definitely can't into a dictionary
Json string inside won't have (), only a {} and []
In addition to the left of the key best should be wrapped in double quotation marks, or a lot of converter are not
You on the network search json check, can use the tool to check whether the string is in line with the json format

CodePudding user response:

The json format is wrong.

CodePudding user response:

Excuse me, are you manually or use which framework parse

CodePudding user response:

This is the right NSDictionary format, can you provide parsing code

CodePudding user response:

This is the JSON data request or as written on the format and the problem by themselves

CodePudding user response:

You this is a set of array format is a dictionary, array in the dictionary

CodePudding user response:

reference 1/f, don't worry reply:
this is a look is not in conformity with the json string specification, so definitely can't into a dictionary
Json string inside won't have (), only a {} and []
In addition to the left of the key best should be wrapped in double quotation marks, or a lot of converter are not
You on the network search json check, can use the tool to check whether the string is operator in accordance with the json format

The parentheses is brackets, he this is copy in the console

CodePudding user response:

To array HeWeather6 first, and then take firstObject, is the basic object, and then take the field in the basic, back in the same way
  •  Tags:  
  • iOS
  • Related