开发者

NSXMLParser problem in iPhone

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜