我正在寻找一些工具/应用程序/调整,可以产生低内存警告的iPhone (越狱)。或者,作为模拟高内存使用率的替代变体调整。
我需要它来测试我的应用程序在低内存警告时的行为。
发布于 2012-09-14 21:42:05
_performMemoryWarning#if DEBUG [UIApplication sharedApplication performSelector:@selector(_performMemoryWarning)];#endif
CFNotificationCenterPostNotification(CFNotificationCenterGetDarwinNotifyCenter(),(CFStringRef)@"UISimulatedMemoryWarningNotification",NULL,NULL,true);
发布于 2012-09-14 21:43:32
当你在模拟器上运行应用程序时,你可以通过:
硬件(在顶部菜单上) ->模拟内存警告
对于真实的设备,你可以用一个私有的方法来实现:
[[UIApplication sharedApplication] performSelector:@selector(_performMemoryWarning)];https://stackoverflow.com/questions/12425720
复制相似问题