Details
-
New Feature
-
Status: Closed
-
Blocker
-
Resolution: Not A Problem
-
2.1.0
-
None
-
None
-
iOS version 5+
Description
First of all I'm sorry if writing here is the wrong place but it's really hard to find some technical help about cordova.
Straight to the problem : I have built a custom iOS plugin (basically an advanced version of CDVCamera) When the plugin is called, using cordova.exec(..), my cameraController is presented as modalController on top of mine CDVViewcontroller subclass, using the cameraController my app receive some memory warnings that cause the unload of the CDVCordovaView.
Looking in to the iOS cordova lib code I noted that this scenario is faced by CDVViewcontroller by checking if one of the plugin has pending operation and if yes the memory is not purged.
To achieve this the plugin(i.e CDVCamera) use the property hasPendingOperation
this property is set to true during the plugin lifecycle and to false once the operation are finished.
So inspired by the CDVCamera code I've declared this property and set it to true during my capture operations, but didn't work.
The problem,or at least one of the problems, is that didReceiveMemoryWarning is not called on CDVViewController but is called in his subclass and even if I call [super didReceiveMemoryWarning] the method of the superClass is not called,
in any case viewDidunload is called on the superClass causing the "freeze" of my app.
So after this long story the question is how can I achieve the behavior of CDVCamera in a custom plugin, that is , how avoid the unload of the CDVCordovaView during a memory warning.
Thanks in advance for any help / suggestion