我必须从 Appdelegate.m 更新我的 WebView
我这样尝试:
[self performSelectorOnMainThread:@selector(loadWebViewWithContent:) withObject:requestObj waitUntilDone:NO];
loadWebViewWithContent 方法在 ViewController.m 中效果很好,但在 Appdelegate 中效果不佳。
我已经在我的 Appdelegate.h 中写了这个:
-(void)loadWebViewWithContent:(NSURLRequest *)requestObj;
怎么了?请帮我。我仍然是 IOS 的大菜鸟。
错误:
-[AppDelegate loadWebViewWithContent]: unrecognized selector sent to instance 0x1f86a5e0*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[AppDelegate loadWebViewWithContent]: unrecognized selector sent to instance 0x1f86a5e0'
更新(新尝试):UIViewController *view = [[UIViewController alloc] init];
[view performSelectorOnMainThread:@selector(loadWebViewWithContent:) withObject:requestObj waitUntilDone:NO];