如何解析比 NSString 更长的 JSON 文件?
我有点陷入一个项目中。 我正在编写一些代码来获取 JSON 文件并将其存储在 NSString 中,然后将其解析为 NSArray。
但我收到一个错误:
2010-10-27 20:59:44.813 GeraldKrvyn[21752:207] -JSONValue 失败。错误跟踪是:( “Error Domain=org.brautaset.JSON.ErrorDomain Code=3 \“无法识别的前导字符\” UserInfo=0x7637890 {NSLocalizedDescription=无法识别的前导字符}”
我认为问题与 NSString 可以采用的有限值有关。
顺便说一句,这是我正在使用的提要: http://www.geraldkervyn.com/api/get_recent_posts/
将其解析为 NSArray 最方便的方法是什么?
谢谢 !
I'm a bit stuck in a project.
I was writing some code to get a JSON file and store it in an NSString before parsing it into a NSArray.
But I get an error:
2010-10-27 20:59:44.813 GeraldKervyn[21752:207] -JSONValue failed. Error trace is: (
"Error Domain=org.brautaset.JSON.ErrorDomain Code=3 \"Unrecognised leading character\" UserInfo=0x7637890 {NSLocalizedDescription=Unrecognised leading character}"
I think the problem is related to the limited value that an NSString can take.
BTW this is the feed I'm using : http://www.geraldkervyn.com/api/get_recent_posts/
What would be the most convenient way to parse this into an NSArray ?
Thanks !
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
首先,将 SBJson 代码添加到您的项目中(由 Stig Brautaset 提供)。然后这样做...
First, Add the SBJson code to your project, courtesy of Stig Brautaset. Then do this...