所以我正在制作一个城市规划应用程序,为了开始练习JSON,我已经制作了一个简单的文件,其中包含城市名称,三座最高的建筑和人口……这是我的JSON文件的样子...
[{ "city" : "New York", "Buildings" : [ One World Trade Center, 432 Park Avenue, Empire State Building ], "pop" : 21,000,000 },
[{ "city" : "Chicago", "Buildings" : [ Sears Tower, Trump Tower, AON Center ], "pop" : 9,000,000 },
[{ "city" : "Philadelphia", "Buildings" : [ Comcast Center, One Liberty Place, Two Liberty Place ], "pop" : 6,000,000 }]使用表视图和序列化代码可以正确设置所有内容,但我一直收到错误消息
Error Domain=NSCocoaErrorDomain Code=3840 "The operation couldn’t be completed. (Cocoa error 3840.)" (Invalid value around character 40.) 任何帮助都将不胜感激。谢谢!
发布于 2015-10-11 06:24:41
您可能希望显示代码,但这可能无关紧要,因为您的数据不是格式正确的JSON,这可能是这里的实际问题所在。首先,你的一些字符串没有被引用。另一方面,你拥有的远不止这些。
https://stackoverflow.com/questions/33059538
复制相似问题