title: Issues when add cordova to my existing ios project: cordovaSettingForKey:]: unrecognized selector sent to instance
body: <p>I tried to add cordova project into my existing ios project. I can successful compile the app.   But when I run it, I got this exceptions for cordovaSettingForKey. </p>
  
  <p>-[__NSDictionaryM cordovaSettingForKey:]: unrecognized selector sent to instance 0x147052a30</p>
  
  <p>EXCEPTION THROW: -[__NSDictionaryM cordovaSettingForKey:]: unrecognized selector sent to instance 0x147052a30</p>
  
  <p>Anyone knows how to resolve the problem</p>
  
  <p>Here is the header file</p>
  
  <pre><code>#import &lt;Cordova/CDVViewController.h&gt;
  #import &lt;Cordova/CDVCommandDelegateImpl.h&gt;
  #import &lt;Cordova/CDVCommandQueue.h&gt;
  
  @interface MainViewController : CDVViewController
  
  @end
  
  @interface MainCommandDelegate : CDVCommandDelegateImpl
  @end
  
  @interface MainCommandQueue : CDVCommandQueue 
  @end
  </code></pre>
  
  <p>Here is the .m file</p>
  
  <pre><code>#import "MainViewController.h"
  
  @implementation MainViewController
  
  - (id)initWithNibName:(NSString*)nibNameOrNil bundle:(NSBundle*)nibBundleOrNil
  {
      self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
      if (self) {
          // Uncomment to override the CDVCommandDelegateImpl used
          // _commandDelegate = [[MainCommandDelegate alloc] initWithViewController:self];
          // Uncomment to override the CDVCommandQueue used
          // _commandQueue = [[MainCommandQueue alloc] initWithViewController:self];
      }
      return self;
  }
  
  - (id)init
  {
      self = [super init];
      if (self) {
          // Uncomment to override the CDVCommandDelegateImpl used
          // _commandDelegate = [[MainCommandDelegate alloc] initWithViewController:self];
          // Uncomment to override the CDVCommandQueue used
          // _commandQueue = [[MainCommandQueue alloc] initWithViewController:self];
      }
      return self;
  }
  
  - (void)didReceiveMemoryWarning
  {
      // Releases the view if it doesn't have a superview.
      [super didReceiveMemoryWarning];
  
      // Release any cached data, images, etc that aren't in use.
  }
  
  #pragma mark View lifecycle
  
  - (void)viewWillAppear:(BOOL)animated
  {
      // View defaults to full size.  If you want to customize the view's size, or its subviews (e.g. webView),
      // you can do so here.
  
      [super viewWillAppear:animated];
  }
  
  - (void)viewDidLoad
  {
      [super viewDidLoad];
      // Do any additional setup after loading the view from its nib.
  }
  
  - (void)viewDidUnload
  {
      [super viewDidUnload];
      // Release any retained subviews of the main view.
      // e.g. self.myOutlet = nil;
  }
  
  - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
  {
      // Return YES for supported orientations
      return [super shouldAutorotateToInterfaceOrientation:interfaceOrientation];
  }
  
  /* Comment out the block below to over-ride */
  
  /*
  - (UIWebView*) newCordovaViewWithFrame:(CGRect)bounds
  {
      return[super newCordovaViewWithFrame:bounds];
  }
  */
  
  @end
  
  @implementation MainCommandDelegate
  
  /* To override the methods, uncomment the line in the init function(s)
     in MainViewController.m
   */
  
  #pragma mark CDVCommandDelegate implementation
  
  - (id)getCommandInstance:(NSString*)className
  {
      return [super getCommandInstance:className];
  }
  
  - (NSString*)pathForResource:(NSString*)resourcepath
  {
      return [super pathForResource:resourcepath];
  }
  
  @end
  
  @implementation MainCommandQueue
  
  /* To override, uncomment the line in the init function(s)
     in MainViewController.m
   */
  - (BOOL)execute:(CDVInvokedUrlCommand*)command
  {
      return [super execute:command];
  }
  
  @end
  </code></pre>
  
  <p>Here is how I call it</p>
  
  <pre><code>MainViewController * layer = [[MainViewController alloc] initWithNibName:@"MainViewController" bundle:nil];
  </code></pre>
  
  <p>Thanks</p>
  
  <p>-Emmy</p>