I want to get the updates from a website based on the titles and links which is in xml format.
我尝试了以下法典,但没有奏效。 仅此,它就发出以下信息:
2011-11-03 14:45:05.987 tabbar[673:e903] * Terminating app due to uncaught exception NSInvalidArgumentException , reason: -[NSCFString isEqualtostring:]: unrecognized selector sent to instance 0x5746830
如果我再次开张,表上的观点是负荷的,但表中没有数据。
该信息在<条码>上显示([部分内容为:@”项目]条码>:
program received signal SIGABRT
-(void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName attributes:(NSDictionary *)attributeDict
{
classelement = elementName;
if ([elementName isEqualtostring:@"item"])
{
itemselected = YES;
multitle = [[NSMutableString alloc]init];
mullink = [[NSMutableString alloc]init];
}
}
-(void)parser:(NSXMLParser *)parser didEndElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedname:(NSString *)qName
{
if ([elementName isEqualToString:@"item"])
{
itemselected = NO;
[titlearray addObject:multitle];
[linkarray addObject:mullink];
[multitle release];
[mullink release];
[self.tbl reloadData];
}
}
-(void)parser:(NSXMLParser *)parser foundCharacters:(NSString *)string
{
if (itemselected)
{
if ([classelement isEqualToString:@"title"])
{
NSLog(@"%@",string);
[multitle appendString:multitle];
}
else if([classelement isEqualToString:@"link"])
{
[multitle appendString:string];
}
}
}