I had to do an update in my WebView from the Appdelegate.m
I try it like this:
[self performSelectorOnMainThread:@selector(loadWebViewWithContent:) withObject:requestObj waitUntilDone:NO];
The loadWebViewWithContent Method works great from ViewController.m, but not from the Appdelegate.
I allready wrote this in my Appdelegate.h:
-(void)loadWebViewWithContent:(NSURLRequest *)requestObj;
Whats wrong? Please help me. I´m still a big Noob in IOS.
Error:
-[AppDelegate loadWebViewWithContent]: unrecognized selector sent to instance 0x1f86a5e0*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[AppDelegate loadWebViewWithContent]: unrecognized selector sent to instance 0x1f86a5e0'
UPDATE(new try): UIViewController *view = [[UIViewController alloc] init];
[view performSelectorOnMainThread:@selector(loadWebViewWithContent:) withObject:requestObj waitUntilDone:NO];
It seems you are calling method in
AppDelegateitself. But there is no method inAppDelegatecalledloadWebViewWithContent:if you want to call the method from
AppDelegatetoViewController, you should use,ViewControllerinstance to call that method, use like this[viewController performSelectorOnMainThread:@selector(loadWebViewWithContent:) withObject:requestObj waitUntilDone:NO];