我正在通过 API 下载 Google 天气。我在解析时遇到问题。
使用 NSXMLParserDelegate,它找到了元素“forecast_conditions”,但我似乎无法提取它的内容。解析器似乎认为“高”和“低”等是独立的元素。
这是我试图解析的一个元素:
<forecast_conditions><day_of_week data="Sun"/><low data="20"/><high data="38"/><icon data="/ig/images/weather/sunny.gif"/><condition data="Clear"/></forecast_conditions>
我很惊讶 ...
`- (void)parser:(NSXMLParser *)parser foundCharacters:(NSString *)string{
NSLog(@"foundCharacters string: %@",string);
}`
也不返回任何东西。我以为这解析了一个元素的内容
帮助表示赞赏。