objective c - libc++abi.dylib: terminating with uncaught exception of type NSException in Xcode 8.0 -
i quite new ios app developing. working on project builded long time ago (i think in 2011).
i don't have knowledge xcode , objective c.
i have solved of problems can't solved 1 :(
although many other peoples asked question can't find solution of this.
i getting error
2016-10-26 12:51:59.200 testcordova1[12758:1094626] *** terminating app due uncaught exception 'nsinvalidargumentexception', reason: '- [appdelegate application:didfinishlaunchingwithoptions:]: unrecognized selector sent instance 0x7fc476e02be0' *** first throw call stack: ( 0 corefoundation 0x000000010310134b __exceptionpreprocess + 171 1 libobjc.a.dylib 0x000000010221621e objc_exception_throw + 48 2 corefoundation 0x0000000103170f34 -[nsobject(nsobject) doesnotrecognizeselector:] + 132 3 corefoundation 0x0000000103086a2e ___forwarding___ + 526 4 corefoundation 0x0000000103086798 _cf_forwarding_prep_0 + 120 5 testcordova1 0x0000000101ba8810 -[appdelegate application:didfinishlaunchingwithoptions:] + 304 6 uikit 0x0000000103e5568e -[uiapplication _handledelegatecallbackswithoptions:issuspended:restorestate:] + 290 7 uikit 0x0000000103e57013 -[uiapplication _callinitializationdelegatesformainscene:transitioncontext:] + 4236 8 uikit 0x0000000103e5d3b9 -[uiapplication _runwithmainscene:transitioncontext:completion:] + 1731 9 uikit 0x0000000103e5a539 -[uiapplication workspacedidendtransaction:] + 188 10 frontboardservices 0x000000010832a76b __fbsserialqueue_is_calling_out_to_a_block__ + 24 11 frontboardservices 0x000000010832a5e4 -[fbsserialqueue _performnext] + 189 12 frontboardservices 0x000000010832a96d -[fbsserialqueue _performnextfromrunloopsource] + 45 13 corefoundation 0x00000001030a6311 __cfrunloop_is_calling_out_to_a_source0_perform_function__ + 17 14 corefoundation 0x000000010308b59c __cfrunloopdosources0 + 556 15 corefoundation 0x000000010308aa86 __cfrunlooprun + 918 16 corefoundation 0x000000010308a494 cfrunlooprunspecific + 420 17 uikit 0x0000000103e58db6 -[uiapplication _run] + 434 18 uikit 0x0000000103e5ef34 uiapplicationmain + 159 19 testcordova1 0x0000000101ba5714 main + 100 20 libdyld.dylib 0x00000001057fb68d start + 1 ) libc++abi.dylib: terminating uncaught exception of type nsexception (lldb)
my main.m file
#import <uikit/uikit.h> int main(int argc, char* argv[]) { nsautoreleasepool * pool = [[nsautoreleasepool alloc] init]; int retval = uiapplicationmain(argc, argv, nil, @"appdelegate"); [pool release]; return retval; }
appdelegate.h
#import <uikit/uikit.h> #import <cordova/cdvviewcontroller.h> @interface appdelegate : cdvviewcontroller { nsstring* invokestring; } @property (copy) nsstring* invokestring; @property (weak) iboutlet uiwindow *window; @property(nonatomic, strong) uiviewcontroller *viewcontroller; @end
appdelegate.m file
#import <uikit/uikit.h> #import "mainviewcontroller.h" #import <avfoundation/avfoundation.h> #import "abcplugin.h" #import "fileio.h" #import "appdelegate.h" @implementation appdelegate @synthesize invokestring; - (id) init { return [super init]; } - (bool)application:(uiapplication *)application didfinishlaunchingwithoptions:(nsdictionary *)launchoptions { nsarray *keyarray = [launchoptions allkeys]; if ([launchoptions objectforkey:[keyarray objectatindex:0]]!=nil) { nsurl *url = [launchoptions objectforkey:[keyarray objectatindex:0]]; self.invokestring = [url absolutestring]; nslog(@"lemobileapp launchoptions = %@",url); } bool retval = [super application:application didfinishlaunchingwithoptions:nil]; if (retval == yes) { // set root view controller of window [self.window setrootviewcontroller:self.viewcontroller]; abcplugin* objabcplugin = [[abcplugin alloc] init]; [objabcplugin showsplashscreen]; } return retval; } - (bool)application:(uiapplication *)application handleopenurl:(nsurl *)url { } -(id) getcommandinstance:(nsstring*)classname { return [super getcommandinstance:classname]; } - (void)webviewdidfinishload:(uiwebview *)thewebview { if(self.invokestring) { nsstring* jsstring = [nsstring stringwithformat:@"var invokestring = \"%@\";", self.invokestring]; [thewebview stringbyevaluatingjavascriptfromstring:jsstring]; } [ super webviewdidfinishload:thewebview ]; [[avaudiosession sharedinstance] setcategory:avaudiosessioncategoryplayback error:nil]; // add our custom splashscreen abcplugin* objabcplugin = [[abcplugin alloc] init]; [objabcplugin showsplashscreen]; return; } - (void)webviewdidstartload:(uiwebview *)thewebview { return [ super webviewdidstartload:thewebview ]; } - (bool)webview:(uiwebview *)thewebview shouldstartloadwithrequest: (nsurlrequest *)request navigationtype: (uiwebviewnavigationtype)navigationtype { nsurlrequest * req = request; if ([[[request url] absolutestring] isequaltostring: @"about:blank"]) { nslog(@"rewriting blank"); nsstring* app = [[nsbundle mainbundle] resourcepath]; nsstring* newpath = [nsstring stringwithformat: @"%@/www/index.html", app]; nsurl* newurl = [nsurl fileurlwithpath:newpath]; req = [nsurlrequest requestwithurl:newurl]; } return [ super webview:thewebview shouldstartloadwithrequest:req navigationtype:navigationtype ]; } - (bool)execute:(cdvinvokedurlcommand*)command { return [ super execute:command]; } - (void)dealloc { [ super dealloc ]; } @end
i devloping using
cordova
.
any appreciated
Comments
Post a Comment