ml杜邦俊 2015-06-27 01:38 采纳率: 75%
浏览 1981
已采纳

iOS json parser 解析字符串

(
{
address = "xx-xx-xxxx,x - street, x - country";
email = "ravi@gmail.com";
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 = "johnny_depp@gmail.com";
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 = "leonardo_dicaprio@gmail.com";
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 = "john_wayne@gmail.com";
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 = "angelina_jolie@gmail.com";
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 = "dido@gmail.com";
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 = "adele@gmail.com";
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 = "hugh_jackman@gmail.com";
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 = "will_smith@gmail.com";
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 = "clint_eastwood@gmail.com";
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 = "barack_obama@gmail.com";
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 = "kate_winslet@gmail.com";
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 = "eminem@gmail.com";
gender = male;
id = c2012;
name = Eminem;
phone = {
home = "00 000000";
mobile = "+91 0000000000";
office = "00 000000";
};
}
)
如何解析上面这些数据解析成数据字典的格式

  • 写回答

1条回答 默认 最新

  • xqqkl 2015-06-27 01:56
    关注

    字典?address是key吗?
    首先你这个不是json格式的 可以使用bejson校验一下
    ios中json的解析参考这里

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 #MATLAB仿真#车辆换道路径规划
  • ¥15 java 操作 elasticsearch 8.1 实现 索引的重建
  • ¥15 数据可视化Python
  • ¥15 要给毕业设计添加扫码登录的功能!!有偿
  • ¥15 kafka 分区副本增加会导致消息丢失或者不可用吗?
  • ¥15 微信公众号自制会员卡没有收款渠道啊
  • ¥100 Jenkins自动化部署—悬赏100元
  • ¥15 关于#python#的问题:求帮写python代码
  • ¥20 MATLAB画图图形出现上下震荡的线条
  • ¥15 关于#windows#的问题:怎么用WIN 11系统的电脑 克隆WIN NT3.51-4.0系统的硬盘