Multiple URL Parsing using Iphone SDK

hardcoredlw

New Member
I have different section like Mechanical,Electrical,green Engineering,etc. with One Article Link for each section. Now, I want to parse this Urls asynchronously & save the content of parsing in the database??RightNow, i did like when you clicked any section, then that url will parse & save its content in database. I used XML parser class called KMXML Parser.My code is as follow:\[code\]- (void)viewDidLoad { KMXMLParser *parser = [[KMXMLParser alloc] initWithURL:link_url delegate:self]; _parseResults = [parser posts]; NSLog(@"%@",_parseResults); for (int k=0; k<[_parseResults count]; k++) { NSString *source; NSLog(@"%d",k); if (self.parseResults) { if([self.parseResults count]!= 0) { source = [NSString stringWithFormat:@"%@",[[self.parseResults objectAtIndex:k] objectForKey:@"summary"]]; NSLog(@"%@",source); } } [postImage setImageWithURL: [self getImageURLFromHTML:source]]; //for getting images from feed parsing }}- (void)stripHTMLFromSummary { int i = 0; int count = self.parseResults.count; //cycles through each 'summary' element stripping HTML while (i < count) { NSString *tempString = [[self.parseResults objectAtIndex:i] objectForKey:@"summary"]; NSMutableDictionary *dict = [self.parseResults objectAtIndex:i]; [dict setObject:tempString forKey:@"summary"]; [self.parseResults replaceObjectAtIndex:i withObject:dict]; i++; }}#pragma mark - KMXMLParser Delegate- (void)parserDidFailWithError:(NSError *)error {}- (void)parserCompletedSuccessfully { [[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:NO];}- (void)parserDidBegin { [[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:YES];}\[/code\]
 
Back
Top