在 iPhone 中加载应用程序时出现问题

发布于 2024-11-15 07:56:04 字数 218 浏览 1 评论 0原文

我创建了一个完全基于 RSS feed 运行的应用程序。当应用程序在设备中首次启动时,它运行良好,没有任何错误。

但当第二次打开时,会出现应用程序的启动屏幕。此时,在后台,提要开始从 url 进行解析。这里我有大约 15 个 URL,每个 URL 有 50 个提要。在这种情况下,加载我的应用程序的时间会增加,因此我的应用程序会崩溃。如何解决这个问题......

请朋友们帮助我......

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......

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

雄赳赳气昂昂 2024-11-22 07:56:05

听起来您的应用程序正在尝试继续其代码并将属性设置为屏幕或尚未加载或解析的其他区域。我会通过在应用程序加载涉及的方法中设置日志语句来检查是否确实是这种情况。如果这确实是问题所在,您所要做的就是确保在它提供的数据准备好之前不会调用其余的代码

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

梦回梦里 2024-11-22 07:56:05

我认为主要是因为内存泄漏。你必须使用。

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

instead of

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

如果不查看代码,就无法判断崩溃发生在哪里。发布您的崩溃日志,这对于准确回答您的问题非常有用。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文