Problemas com Parse XML - Iphone

前端 未结 2 788
迷失自我
迷失自我 2021-01-26 17:45

English translation not by OP. Original follows.

Gentleman,

I\'m connecting to a web server and getting an XML file that has the following format:

相关标签:
2条回答
  • 2021-01-26 18:06

    I do not speak Portuguese but I do speak Spanish so I think I understand some of your problems.

    You would be much better of using a wrapper library for parsing XMLs called TouchXML.

    It is very easy to use, if you need more information leave a comment.

    0 讨论(0)
  • 2021-01-26 18:09

    In -(void)parser:(NSXMLParser *)parser foundCharacters:(NSMutableString *)string you're setting the currentNodeContent to the string. I believe you'd want to append string to the currentNodeContent instead of replacing it.


    Portuguese translation

    No método -(void)parser:(NSXMLParser *)parser foundCharacters:(NSMutableString *)string você está setando o currentNodeContent para o que vem na string, mas fazendo isso você perde o que já estava lá antes. Provavelmente esse método é chamado separado quando o parser acha um acento, por isso que os pedaços ficam separados. Você deveria fazer um append do currentNodeContent com a string ao invés de substituir o que já tinha antes.

    0 讨论(0)
提交回复
热议问题