0

I am trying out this application found over here: http://blog.objectgraph.com/index.php/2010/02/24/parsing-html-iphone-development/

this application is contantly crashing.. i think there is a mem. leaking could any one help me fix this

thanks

kennytm
  • 510,854
  • 105
  • 1,084
  • 1,005
Tushar Chutani
  • 1,522
  • 5
  • 27
  • 57

1 Answers1

1

okay here is yar solution... you released htmlData at the end. dont release it. cause you didn't alloc that...

NSData *htmlData = [NSData dataWithContentsOfURL:[NSURL URLWithString: @"http://www.objectgraph.com   /contact.html"]];
TFHpple *xpathParser = [[TFHpple alloc] initWithHTMLData:htmlData];     
NSArray *elements  = [xpathParser search:@"//h3"]; // get the page title
TFHppleElement *element = [elements objectAtIndex:0];
NSString *h3Tag = [element content];  
NSLog(@"Html tags :%@",h3Tag);
mLabel.text = h3Tag;
[xpathParser release];
makboney
  • 1,808
  • 1
  • 17
  • 34