0
當我試圖執行這段代碼時,我的應用程序崩潰。我是Objective-C的新手,所以我不確定問題是什麼。Objective-C UIWebView初始化錯誤
- (void)loadWebView:(NSURL *)url {
UIWebView *nWeb = _webView;
if(nWeb == nil) {
nWeb =[[UIWebView alloc]init];
}
[[self webView] loadRequest:[NSURLRequest requestWithURL:url]];
self.view = nWeb;
}
錯誤:
2016-03-13 08:32:39.885 [info][tid:com.facebook.React.JavaScript] Running application "TheNativeMobileWeb" with appParams: {"rootTag":1,"initialProps":{}}. __DEV__ === true, development-level warning are ON, performance optimizations are OFF
2016-03-13 08:32:41.259 TheNativeMobileWeb[82483:9025502] VIEWCONTROLLER YEAH changed
2016-03-13 08:32:41.259 TheNativeMobileWeb[82483:9025502] https://facebook.github.io/react-native/
2016-03-13 08:32:41.259 TheNativeMobileWeb[82483:9025502] https://facebook.github.io/react-native/
1 0x11873ba2e StartWebThread()
2 0x110bb0eaf __pthread_once_handler
3 0x110bc5f13 _os_once
4 0x110bb0e4e pthread_once
5 0x11773925e +[WebView(WebPrivate) enableWebThread]
6 0x117733616 WebKitInitialize
7 0x10ebf3efb ___UIApplicationLoadWebKit_block_invoke
8 0x11087949b _dispatch_client_callout
9 0x110864e28 dispatch_once_f
10 0x10c4dabff _class_initialize
11 0x10c4e0d23 lookUpImpOrForward
12 0x10c4ef8bb objc_msgSend
13 0x10bd73fc0 -[ViewController loadWebView:]
14 0x10bd73db3 -[ViewController loadURL:]
15 0x10bd73cc0 -[ViewController changedURL:]
16 0x10d2a269c __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__
17 0x10d2a23db _CFXRegistrationPost
18 0x10d2a2142 ___CFXNotificationPost_block_invoke
19 0x10d2e7972 -[_CFXNotificationRegistrar find:object:observer:enumerator:]