title: Getting current UIViewController in Phonegap
body: <p>I'm loading an application (via embedded framework) via a PhoneGap Plugin.<br>
  Now, I'm trying to pass the current UIViewController to the <strong>parentViewController</strong> property of the <em>FlashizFacade</em> object. 
  <br><br>When I execute my application I'm getting this error in the debug console when assigning <em>self</em>:</p>
  
  <blockquote>
    <blockquote>
      <p>2012-09-10 13:01:43.663 gTicketSales[2805:16a03] -[FlashizPlugin navigationController]: unrecognized selector sent to instance 0x91925e0</p>
      
      <p>2012-09-10 13:01:43.665 gTicketSales[2805:16a03] ***WebKit discarded an uncaught exception in the webView:decidePolicyForNavigationAction:request:frame:decisionListener: delegate:<code>&lt;NSInvalidArgumentException&gt;</code>-[FlashizPlugin navigationController]: unrecognized selector sent to instance 0x91925e0</p>
    </blockquote>
  </blockquote>
  
  <p>When assigning <em>self.viewController</em>:</p>
  
  <blockquote>
    <blockquote>
      <blockquote>
        <p>2012-09-10 14:31:21.455 gTicketSales[3693:16a03] ***WebKit discarded an uncaught exception in the webView:decidePolicyForNavigationAction:request:frame:decisionListener: delegate:<code>&lt;Wrong parentViewController specified&gt;</code>When using non-modal display, parentViewController have to be an instance of UIViewController with a valid navigationController assigned</p>
      </blockquote>
    </blockquote>
  </blockquote>
  
  <p>I've tried:</p>
  
  <pre><code>facade.parentViewController = self;
  facade.parentViewController = self.viewController;
  </code></pre>
  
  <h3>My .h file</h3>
  
  <pre><code>#import &lt;Cordova/CDVPlugin.h&gt;
  #import &lt;FlashizPaymentLib/FlashizFacade.h&gt;
  
  @interface FlashizPlugin : CDVPlugin &lt;FlashizPaymentDelegate&gt; {}
  
  @property (nonatomic, retain) FlashizFacade* flashizFacade;
  - (void) openFlashiz:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options;
  
  @end
  </code></pre>
  
  <h3>My .m file</h3>
  
  <pre><code>#import "FlashizPlugin.h"
  @implementation FlashizPlugin
  @synthesize flashizFacade;
  
  - (void) openFlashiz:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options     {
  
  
  NSLog(@"Flashiz Payment Opening...");
  
  NSString *callbackId = [arguments pop];
  NSString *invoiceId = [arguments objectAtIndex:0];
  
  FlashizFacade* facade = [[FlashizFacade alloc] initWithEnvironment:FE_TEST];
  facade.parentViewController = self;
  facade.delegate = self;
  self.flashizFacade = facade;
  [facade executePaymentForInvoiceId:invoiceId];
  [facade release];
  
  CDVPluginResult *result;
  
  result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:@"Flashiz Payment Executed..."];
  [self writeJavascript:[result toSuccessCallbackString:callbackId]];
  
  }
  
  
  @end
  </code></pre>
  
  <p>Thanks in advance!</p>