好吧......iPhone內存管理didReceiveMemoryWarning
我實現在iPhone上簡單的OpenGL ES應用程序,我最近在捏媒體分析補充。這樣做有助於發現內存管理問題,我不完全知道如何處理它。
在一個完美的世界,我的應用程序 - 它加載和PNG圖像文件的.caf在didFinishLoading將啓動,加載所有它的資源,並運行就好了。然而,如果我的程序發生崩潰(發生在我整合捏媒體庫時發生),或者如果我運行Safari並打開一堆頁面然後啓動我的遊戲,遊戲將會回到菜單,因爲它是內存不足。
此問題將持續存在,直到我做了系統的硬重置。
默認的回答,你那種上網是實現didReceiveMemoryWarning方法如下....
- (void)didReceiveMemoryWarning
{
// default behavior is to release the view if it doesn't have a superview.
// remember to clean up anything outside of this view's scope, such as
// data cached in the class instance and other global data.
[super didReceiveMemoryWarning];
}
但是,這並不能真正幫助,因爲它是被保存到存儲器上的其他程序不是我的。我不想釋放我自己的看法嗎?有沒有很好的描述如何處理這種情況和/或didReceiveMemoryWarning事件發生了什麼?
謝謝。我會嘗試延遲加載方法,因爲它只有一個視圖。 – K2Digital 2009-05-28 16:23:20