本文介绍了内存泄漏iPhone sdk?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试在此处找到此应用程序:
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
谢谢
推荐答案
好的这是yar解决方案...
你最后发布了htmlData。不要释放它。因为你没有分配...
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];
这篇关于内存泄漏iPhone sdk?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!