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?)
posted on 2012-03-25 10:02  老Zhan  阅读(270)  评论(0编辑  收藏  举报