问题描述
在我的应用程序中,我将使用相机拍摄图像并将其设置为背景图像。有时我会收到警告警告已收到等级= 1。。在支付了这段时间之后,我得到了另一个警告,因为警告收到等级= 2。在这些时候将会调用didReceiveMemoryWarning方法。如果我 level = 2警告我想向用户显示警告。我怎么能以编程方式做到这一点。
In my application i will take images with camera and set that as background image. some times i am getting Warning as "Warning Received Level=1.". After paying with this for some times, i got another Warning as "Warning Received Level=2." At these times "didReceiveMemoryWarning " method will be called. If I get level=2 Warning I want to display an alert to the User. How Can I do that Programatically.
任何人都可以帮助我。
先谢谢。
Can Anyone Please Help me.Thanks in Advance.
推荐答案
您不应该向用户显示警告 - 用户不关心你得到记忆警告。您应该尝试找出为什么使用这么多内存以及可能有泄漏的原因。
此外,关于内存警报,你应该摆脱当时不需要的东西(并且你可以在需要时轻松重新创建)。
You should not display an alert to the user - it is not the user's concern that you get memory warning. You should rather try and find out why you use so much memory and possibly leaks you might have.Moreover, on memory alerts, you should get rid of things you don't require at that moment (and you can easily recreate when needed).
这篇关于如何在iPhone中的didReceiveMemoryWarning方法中发生level = 2警告时获取警报的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!