iPhoneOS上有没有弱引用的类==>没有任何

发布于 2024-09-07 10:22:20 字数 226 浏览 1 评论 0原文

我的APP收到了一个大数据,大约被使用了两次。 所以,我认为这会导致记忆问题。

在本例中,我使用 java 上的 WeakReference 类。 但是,我找不到像java这样的弱引用类。

iPhoneOS 上是否有弱引用类?

在这种情况下这是唯一的方法吗? 使用 didReceiveMemoryWarning 方法并释放代码。

谢谢。

My APP received a big data that was used about twice times.
So, I think It`ll cause a memory problem.

In this case I use the WeakReference class on java.
But, I couldn`t find any class for weak references like java.

Is there any class for weak refereces on iPhoneOS?

Is this the only way in this case,
that using didReceiveMemoryWarning method and release code.

Thx.

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

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

发布评论

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

评论(2

踏雪无痕 2024-09-14 10:22:20

iPhoneOS SDK 不支持垃圾收集,因此实际上并不需要实现弱引用的类。我建议您通过 Instruments 运行您的应用程序(从 Xcode 3.2.3 中选择“运行”->“使用性能工具运行”->“分配”。这将帮助您了解应用程序的内存使用情况并检测可能的泄漏。

iPhoneOS SDK does not support garbage collection so classes that implement weak referencing are not really needed. What I would suggest is that you run your app through Instruments (Choose Run->Run WIth Performance Tools->Allocations from Xcode 3.2.3. This will help you understand the memory usage of your app and detect possible leaks.

若水般的淡然安静女子 2024-09-14 10:22:20

我认为如果您想处理大数据,您应该使用持久存储,因为内存不允许您超出其限制。

I think you should use persistent storage, if you want to play with big data because memory will not allow you beyond its limit.

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