我試圖分析一個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