【发布时间】:2012-09-14 13:36:27
【问题描述】:
我正在寻找一些可以在 iPhone 上生成内存不足警告(越狱)的工具/应用程序/调整。或者,作为替代变体 - 模拟高内存使用的调整。
我需要它来测试我的应用在内存不足警告时的行为。
【问题讨论】:
标签: iphone cydia tweak low-memory
我正在寻找一些可以在 iPhone 上生成内存不足警告(越狱)的工具/应用程序/调整。或者,作为替代变体 - 模拟高内存使用的调整。
我需要它来测试我的应用在内存不足警告时的行为。
【问题讨论】:
标签: iphone cydia tweak low-memory
在你的设备上,你可以调用私有方法_performMemoryWarning
#if DEBUG
[[UIApplication sharedApplication] performSelector:@selector(_performMemoryWarning)];
#endif
另一种解决方案是手动发送通知:
CFNotificationCenterPostNotification(CFNotificationCenterGetDarwinNotifyCenter(), (CFStringRef)@"UISimulatedMemoryWarningNotification", NULL, NULL, true);
【讨论】:
当您在模拟器上运行应用程序时,您可以这样做:
硬件(在顶部菜单上)-> 模拟内存警告
对于真实设备,您可以使用私有方法:
[[UIApplication sharedApplication] performSelector:@selector(_performMemoryWarning)];
【讨论】: