I tried adding a cordova project to my existing ios project. I can successfully compile the application. But when I run it, I have exceptions for cordovaSettingForKey.
- [__ NSDictionaryM cordovaSettingForKey:]: unrecognized selector sent to instance 0x147052a30
EXCLUSION OF FRACTION: - [__ NSDictionaryM cordovaSettingForKey:]: unrecognized selector sent to instance 0x147052a30
Does anyone know how to solve a problem.
Here is the header file
#import <Cordova/CDVViewController.h>
#import <Cordova/CDVCommandDelegateImpl.h>
#import <Cordova/CDVCommandQueue.h>
@interface MainViewController : CDVViewController
@end
@interface MainCommandDelegate : CDVCommandDelegateImpl
@end
@interface MainCommandQueue : CDVCommandQueue
@end
Here is the .m file
#import "MainViewController.h"
@implementation MainViewController
- (id)initWithNibName:(NSString*)nibNameOrNil bundle:(NSBundle*)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
}
return self;
}
- (id)init
{
self = [super init];
if (self) {
}
return self;
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
}
#pragma mark View lifecycle
- (void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
}
- (void)viewDidLoad
{
[super viewDidLoad];
}
- (void)viewDidUnload
{
[super viewDidUnload];
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return [super shouldAutorotateToInterfaceOrientation:interfaceOrientation];
}
@end
@implementation MainCommandDelegate
#pragma mark CDVCommandDelegate implementation
- (id)getCommandInstance:(NSString*)className
{
return [super getCommandInstance:className];
}
- (NSString*)pathForResource:(NSString*)resourcepath
{
return [super pathForResource:resourcepath];
}
@end
@implementation MainCommandQueue
- (BOOL)execute:(CDVInvokedUrlCommand*)command
{
return [super execute:command];
}
@end
That's what I call him
MainViewController * layer = [[MainViewController alloc] initWithNibName:@"MainViewController" bundle:nil];
thank
-Emmy
source
share