Skip to content

Instantly share code, notes, and snippets.

@azsromej
Created July 11, 2012 19:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save azsromej/3092479 to your computer and use it in GitHub Desktop.
Save azsromej/3092479 to your computer and use it in GitHub Desktop.
Debugging with repeated memory warnings
#warning REMOVE THIS BEFORE RELEASE
- (void)fireMemoryWarning:(NSTimer *)timer {
NSLog(@"<<<< posting simulated warning >>>>");
[[UIApplication sharedApplication] performSelector:@selector(_performMemoryWarning)];
}
#warning REMOVE THIS BEFORE RELEASE
-(void) debugWithRepeatedMemoryWarnings {
[NSTimer scheduledTimerWithTimeInterval:20 target:self
selector:@selector(fireMemoryWarning:)
userInfo:nil
repeats:YES];
}
// Add the following line to application:didFinishLaunchingWithOptions:
[self debugWithRepeatedMemoryWarnings];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment