程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 編程語言 >> 更多編程語言 >> 編程綜合問答 >> ios-iOS json parser 解析字符串

ios-iOS json parser 解析字符串

編輯:編程綜合問答
iOS json parser 解析字符串

(
{
address = "xx-xx-xxxx,x - street, x - country";
email = "[email protected]";
gender = male;
id = c200;
name = "Ravi Tamada";
phone = {
home = "00 000000";
mobile = "+91 0000000000";
office = "00 000000";
};
},
{
address = "xx-xx-xxxx,x - street, x - country";
email = "[email protected]";
gender = male;
id = c201;
name = "Johnny Depp";
phone = {
home = "00 000000";
mobile = "+91 0000000000";
office = "00 000000";
};
},
{
address = "xx-xx-xxxx,x - street, x - country";
email = "[email protected]";
gender = male;
id = c202;
name = "Leonardo Dicaprio";
phone = {
home = "00 000000";
mobile = "+91 0000000000";
office = "00 000000";
};
},
{
address = "xx-xx-xxxx,x - street, x - country";
email = "[email protected]";
gender = male;
id = c203;
name = "John Wayne";
phone = {
home = "00 000000";
mobile = "+91 0000000000";
office = "00 000000";
};
},
{
address = "xx-xx-xxxx,x - street, x - country";
email = "[email protected]";
gender = female;
id = c204;
name = "Angelina Jolie";
phone = {
home = "00 000000";
mobile = "+91 0000000000";
office = "00 000000";
};
},
{
address = "xx-xx-xxxx,x - street, x - country";
email = "[email protected]";
gender = female;
id = c205;
name = Dido;
phone = {
home = "00 000000";
mobile = "+91 0000000000";
office = "00 000000";
};
},
{
address = "xx-xx-xxxx,x - street, x - country";
email = "[email protected]";
gender = female;
id = c206;
name = Adele;
phone = {
home = "00 000000";
mobile = "+91 0000000000";
office = "00 000000";
};
},
{
address = "xx-xx-xxxx,x - street, x - country";
email = "[email protected]";
gender = male;
id = c207;
name = "Hugh Jackman";
phone = {
home = "00 000000";
mobile = "+91 0000000000";
office = "00 000000";
};
},
{
address = "xx-xx-xxxx,x - street, x - country";
email = "[email protected]";
gender = male;
id = c208;
name = "Will Smith";
phone = {
home = "00 000000";
mobile = "+91 0000000000";
office = "00 000000";
};
},
{
address = "xx-xx-xxxx,x - street, x - country";
email = "[email protected]";
gender = male;
id = c209;
name = "Clint Eastwood";
phone = {
home = "00 000000";
mobile = "+91 0000000000";
office = "00 000000";
};
},
{
address = "xx-xx-xxxx,x - street, x - country";
email = "[email protected]";
gender = male;
id = c2010;
name = "Barack Obama";
phone = {
home = "00 000000";
mobile = "+91 0000000000";
office = "00 000000";
};
},
{
address = "xx-xx-xxxx,x - street, x - country";
email = "[email protected]";
gender = female;
id = c2011;
name = "Kate Winslet";
phone = {
home = "00 000000";
mobile = "+91 0000000000";
office = "00 000000";
};
},
{
address = "xx-xx-xxxx,x - street, x - country";
email = "[email protected]";
gender = male;
id = c2012;
name = Eminem;
phone = {
home = "00 000000";
mobile = "+91 0000000000";
office = "00 000000";
};
}
)
如何解析上面這些數據解析成數據字典的格式

最佳回答:


字典?address是key嗎?
首先你這個不是json格式的 可以使用bejson校驗一下
ios中json的解析參考這裡

  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved