问题
I have created an app for weather reports by using this http://www.google.com/ig/api?weather=paris. It works well for all cities except Paris.
In my app I have a text field; if I type "Sydney", it will show the weather in Sydney,
but if I type "Paris", it gives an error: NSXMLParserErrorDomain error:9
. I don't know what it means. What could be the error? Any idea?
回答1:
According to Apple's documentation it has encountered an illegal character: NSXMLParserInvalidCharacterError = 9,
Make sure you correctly parse this as UTF-8
回答2:
It seems that XML you are parsing contains some UTF-8 characters, but XML does not have proper XML declaration for UTF-8.
Make sure you configure your parser correctly.
来源:https://stackoverflow.com/questions/5964214/problem-parsing-google-weather-data-only-for-paris