I want to test my application in low memory conditions. Previously, my approach to this was fulfilled
[NSTimer scheduledTimerWithTimeInterval:2.0 target:[UIApplication sharedApplication] selector:@selector(_performMemoryWarning) userInfo:nil repeats:YES];
but it no longer works. And by working, I mean that didReceiveMemoryWarning is not being called. I also tried:
[[NSNotificationCenter defaultCenter] postNotificationName:UIApplicationDidReceiveMemoryWarningNotification object: [UIApplication sharedApplication]]; [[NSNotificationCenter defaultCenter] postNotificationName:UIApplicationDidReceiveMemoryWarningNotification object: nil]; [[UIApplication sharedApplication] _performMemoryWarning];
But none of the above work.
Any ideas would be appreciated.
source share