我试图分析一个xml,如果xml提要中有一个空节点,应用程序崩溃。 这可能是什么原因?解析空节点时,iPhone应用程序崩溃
编辑 我的XML看起来像这样
<Sponsors>
<Sponsor>
<Name>name...</Name>
<About>blah...blah...blah</About>
<Website>http://test.com</Website>
<LogoImage>someImage.jpg</LogoImage>
<smallIcon>someImage.jpg</smallIcon>
<Area/>
<BannerImage/>//->>>this node is empty//
</Sponsor>
</Sponsors>
我使用的解析器NSXML这样。
- (void)parser:(NSXMLParser *)parser foundCharacters:(NSString *)string {
if(nil != self.currentsponsorElement){
[self.currentsponsorElement appendString:string];
}
}
我们需要看到您的XML和用于解析它的代码。你在检查错误吗?什么是错误? –
您使用NSXML解析吗? – Deepesh
@elppa是的,我正在使用NSXML解析 – user1268938