title: Cordova iOS custom Plugin : handle memory warning
body: <p>I'm developing an iOS app that use cordova(2.1), and some custom plugins.</p>
  
  <p>The problem that I'm trying to face is the following : 
  When I show my plugin(basically a camera plugin with more features than the built-in
  cordova plugin) sometime I receive a memory warning and a consequent unload of the 
  view containing the webview. This is a really huge issue for me because once my imagePicker
  is dismissed the webview is not restored.</p>
  
  <p>I had a look at the CDVCamera plugin source and what I noted is this : </p>
  
  <p>(1) the plugin save the webview  : </p>
  
  <pre><code> // we need to capture this state for memory warnings that dealloc this object
      cameraPicker.webView = self.webView;
  </code></pre>
  
  <p>here I don't understand what's going on, ok we save the webview in case after a memory
  warning it will be unloaded, but I can't figure it out how/where in the framework the webview 
  is restored.</p>
  
  <p>(2) The plugin use a Bool property called hasPendingOperation, this property If I understood 
  is used by the CDVViewController when a memory warning is received to avoid purging the memory
  if a plugin is active.</p>
  
  <p>The first things that I don't understand is the following why when my controller receive a memory warning
  the supercontroller(CDVViecontroller) don't receive it? </p>
  
  <p>Second is it possible to apply the pattern  used by the CDVCamera plugin in conjunction with the CDVViewController
  to handle memory warnings in custom plugins? </p>
  
  <p>Any helps in manage memory warnings with cordova to avoid the webview to be unloaded will be appreciated.</p>