iPhoneOS上有没有弱引用的类==>没有任何
我的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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
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.
我认为如果您想处理大数据,您应该使用持久存储,因为内存不允许您超出其限制。
I think you should use persistent storage, if you want to play with big data because memory will not allow you beyond its limit.