NSXMLParser中 didEndElement
-(void)parser:(NSXMLParser *)parser didEndElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName{
if([elementName isEqualToString:kName_Item]){
[titleData addObject:currentTitleItem];
}else if ([elementName isEqualToString:kName_Title]) {
currentTitleItem.title = [currentString mutableCopy];
} else if ([elementName isEqualToString:kName_Link]) {
currentTitleItem.link = [currentString mutableCopy];
}
currentTitleItem.title = [currentString mutableCopy];
currentTitleItem.link = [currentString mutableCopy];
应该深拷贝,不然会被有bug,因为复制的时指针(right?)
作者:老Zhan
出处:http://www.cnblogs.com/mybkn/
本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。