我想在低内存条件下测试我的应用程序。以前我的方法是运行程序内存警告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