Skip to content

Commit

Permalink
Merge pull request #5054 from pec1985/timob-3115
Browse files Browse the repository at this point in the history
[TIMOB-3115] iOS: Added memory warning event to Ti.App module
  • Loading branch information
vishalduggal committed Mar 3, 2014
2 parents e34a43f + d97658f commit 6d3f1d9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions apidoc/Titanium/App/App.yml
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,11 @@ events:
summary: Whether accessibility is now enabled or disabled.
type: Boolean

- name: memorywarning
summary: Fired when the app receives a warning from the operating system about low memory availability.
platforms: [iphone, ipad]
since: "3.3.0"

- name: pause
summary: Fired when the application transitions from active to inactive state on a multitasked system.
description: |
Expand Down
4 changes: 4 additions & 0 deletions iphone/Classes/AppModule.m
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,10 @@ - (void)timeChanged:(NSNotification*)notiication

-(void)didReceiveMemoryWarning:(NSNotification*)notification
{
if([self _hasListeners:@"memorywarning"]) {
[self fireEvent:@"memorywarning" withObject:nil];
}

RELEASE_TO_NIL(properties);
#ifdef USE_TI_APPIOS
[self forgetProxy:iOS];
Expand Down

0 comments on commit 6d3f1d9

Please sign in to comment.