开发者

NSXMLParser problem in iPhone

开发者 https://www.devze.com 2023-03-12 02:17 出处:网络
in my app i am using the NSXML parser to fetch data from a network database. here i need to get around 3000 files and more.

in my app i am using the NSXML parser to fetch data from a network database. here i need to get around 3000 files and more.

my problem is i am getting data's around 1000 files and after that my app 开发者_如何学Cgets crashed. Why this happens. Is this because of memory leaks problem or anything else. Please help me friends...


Mostly It is because of the memory leaks. You have to use.

NSData * dataXml = [[NSData alloc] initWithContentsOfURL:url];
NSXMLParser *parser = [[NSXMLParser alloc] initWithData:dataXml];
[dataXml release];
instead of

NSXMLParser *parser = [[NSXMLParser alloc] initWithContentsOfURL:url];
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号