NSXMLParser 错误代码突然=5
我的应用程序读取了一些 xml,直到几天前,我的 NSXMLParser 似乎都毫无问题地读取了它们,没有任何问题。现在其中两个 xml 抛出 code=5 错误。据我所知,这是由于 unicode 错误、解码错误、无效数据或无效字符造成的。文档中的实际错误是 NSXMLParserPrematureDocumentEndError
。
这是导致错误的 XML 之一:
<feed>
<line>
<feed_id></feed_id>
<info_feed></info_feed>
<date_entered></date_entered>
</line>
</feed>
我根本没有接触过这段代码,突然间它抛出了这个解析器错误。有人也发生过这种情况吗?让我头疼的是其余的 xml 仍然可以毫无问题地读取。
My app reads a few xmls and they all seemed to have been read with no problem by my NSXMLParser with no problem whatsoever until a few days ago. Now two of those xmls throw a code=5 error. From what I have read, this is due to a unicode error, decoding error, invalid data, or invalid character. The actual error from the documentation is NSXMLParserPrematureDocumentEndError
.
This is one of the XMLs that causes the error:
<feed>
<line>
<feed_id></feed_id>
<info_feed></info_feed>
<date_entered></date_entered>
</line>
</feed>
I haven't touched this code at all, and all of a sudden it threw this parser error. Has anyone had this happen too? What breaks my head is that the rest of the xmls are still read with no problems.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我的问题是实际的网络项目。上次迁移时,某些因素影响了项目中某些控制器的设置。将 xml 移至 Web 项目中的新文件(而不是应用程序)修复了该问题。
My problem was with the actual web project. Something affected the settings for some controllers in the project on the last migration. Moving the xmls to new files in the web project as opposed to the app fixed the issue.