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?)

你可能感兴趣的:(element)