2011-09-22 124 views
-1

我的應用程序顯示警告接收到內存警告。等級= 2 iPhone

Received memory warning. Level=2. 

完整的警告崩潰是

warning: Unable to read symbols for /Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.3.5 (8L1)/Symbols/Developer/usr/lib/libXcodeDebuggerSupport.dylib (file not found). 

請幫

它是工作在iPhone模擬器罰款,但沒有對實際divice

+0

可能的複製http://stackoverflow.com/questions/2915247/iphone-os-memory-warnings-what-do-the-different-levels-mean – 0x8badf00d

回答

3

是不是隻是一個內存問題? iPad和iPhone的「RAM」非常有限,如果使用太多,系統會發送1級警告和2級警告。如果你之後仍然使用太多的內存,它會殺死你的應用程序。

您不會遇到模擬器上的問題,因爲您的計算機有更多的內存。

如果你想模擬這樣的內存警告,看看你的代碼在這種情況下的行爲。使用此代碼:的

// Do as if there has been a memory warning in the simulator 
+ (void)simulateMemoryWarningInSimulator 
{ 
    #if TARGET_IPHONE_SIMULATOR 
    #ifdef DEBUG 
     CFNotificationCenterPostNotification(CFNotificationCenterGetDarwinNotifyCenter(), (CFStringRef)@"UISimulatedMemoryWarningNotification", NULL, NULL, true); 
    #endif 
    #endif 
} 
0

嘗試在您的xcode項目中添加此框架 - libxml.dylib

是的,如果它看起來像內存問題,請在與樂器配套的設備上運行您的應用程序。它應該告訴你究竟是什麼導致了內存問題。

+0

添加,但不糾正同崩潰 – Mann

+0

編輯的迴應。如果它不起作用,請嘗試運行儀器以找出造成問題的原因。 – Bourne