我想在低內存條件下測試我的應用程序。以前我的方法是運行程序內存警告ios
[NSTimer scheduledTimerWithTimeInterval:2.0 target:[UIApplication sharedApplication] selector:@selector(_performMemoryWarning) userInfo:nil repeats:YES];
但它不工作了。而通過工作,我的意思是didReceiveMemoryWarning未被調用。我也試過:
[[NSNotificationCenter defaultCenter] postNotificationName:UIApplicationDidReceiveMemoryWarningNotification object: [UIApplication sharedApplication]];
[[NSNotificationCenter defaultCenter] postNotificationName:UIApplicationDidReceiveMemoryWarningNotification object: nil];
[[UIApplication sharedApplication] _performMemoryWarning];
但是以上都不起作用。
任何想法,將不勝感激
單擊如果當您使用模擬器硬件菜單(如你在回答您的評論暗示),它甚至不工作,那麼它更可能問題在於你的功能。哪個班級沒有收到該方法?它何時停止工作?你是否重寫了這個方法而不叫超級? – jrturton
我已經重寫了這個方法,我叫超級。正如你所說,班級沒有收到電話。 – TompaLompa
是的,但哪些類? – jrturton