|
Yes 发表于 2021-7-16 09:20
{"contact0":{"lastname":"华为","mobile":"4008308300","mobileEmail":"4008308300"},"contact1":{"mobil ...
我看了一下你的源码,问题出在对json数组和json对象的概念不清,也就是对什么是数组什么是对象分不清,你可以这么理解当你取出的内容是{“”:“”}这种的时候就是对象,当你取出的内容是[]这个标志的时候json数组,那好回到你的例子中:
{"contact0":{"lastname":"华为","mobile":"4008308300","mobileEmail":"4008308300"},"contact1":{"mobile":"2397","mobileEmail":"2397","lastname":"街道"},"contact2":{"lastname":"安埠","mobile":"0466","mobileEmail":"0466"}},上边这一串很明显最外层是{},所以你应该想到用json对象类去处理,再看一下下边的-------[{"lastname":"华为客服","mobile":"4008308300","mobileEmail":"4008308300"},{"mobile":"2397","mobileEmail":"2397","lastname":"街道"},{"lastname":"安埠","mobile":"0466","mobileEmail":"0466"}],最外层是一个[] ,说明他是一个数组,我们就先用json数组类创建一下 |
|