开发者

problem in loading an app in iPhone

开发者 https://www.devze.com 2023-03-12 07:17 出处:网络
i have created an app which works fully 开发者_开发知识库on the basis of an RSS feed. When the app is launched for the first time in a device, it works fine without any error.

i have created an app which works fully 开发者_开发知识库on the basis of an RSS feed. When the app is launched for the first time in a device, it works fine without any error.

But when it is opened for the second time the splash screen of the app appears. At that time in background the feeds are get started parsing from the urls. Here i have around 15 urls and 50 feeds per url. In that case the time to load my app gets increased and because of this my app gets crashed. how to solve this issue....

please help me friends......


It sounds like your app is trying to continue with its code and set attributes to the screen or other areas that aren't yet loaded or parsed. I would check to see if this is indeed the case by setting up log statements in the methods involved with the app loading. And if that does turn out to be the issue, all you have to do is make sure the rest of the code isn't called until the data it presents is ready


I think 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];  

Without seeing the code it is impossible to tell where the crash happens. Post your crash log it will be very useful to answer your question exactly.

0

精彩评论

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