我是Swift和WKWebView的新手。
我在我的应用程序中实现了WKWebView。我想在其中显示一个使用https://www.google.com/maps
之类的位置的网站。
我在NSLocationWhenInUseUsageDescription
中添加了Info.plist
。
[当我第一次打开该应用程序时,会提示您输入位置。
当我单击Allow
时,应用程序因Thread 1: signal SIGABRT
错误而崩溃。
我检查了所有网点,绝对没有错。
也显示错误:
UIAlertView is deprecated and unavailable for UIScene based applications, please use UIAlertController!
但是我没有明确地调用UIAlertView
,所以我不知道如何解决此问题。
我也是,这很烂。
*** Terminating app due to uncaught exception 'NSObjectNotAvailableException', reason: 'UIAlertView is deprecated and unavailable for UIScene based applications, please use UIAlertController!'
*** First throw call stack:
(
0 CoreFoundation 0x00007fff23b98bde __exceptionPreprocess + 350
1 libobjc.A.dylib 0x00007fff503b5b20 objc_exception_throw + 48
2 CoreFoundation 0x00007fff23b98a1c +[NSException raise:format:] + 188
3 UIKitCore 0x00007fff466e9463 -[UIAlertView initWithFrame:] + 417
4 UIKitCore 0x00007fff466e9ad0 -[UIAlertView initWithTitle:message:delegate:cancelButtonTitle:otherButtonTitles:] + 218
5 UIKitCore 0x00007fff47516acf +[UIAlertView(ViewServiceSupport) _alertViewForWindow:] + 217
6 UIKitCore 0x00007fff476cdb44 -[UIWebGeolocationPolicyDecider _executeNextChallenge] + 242
7 WebKit 0x00007fff2d123a6d _ZN6WebKit43decidePolicyForGeolocationRequestFromOriginEPN7WebCore14SecurityOriginERKN3WTF6StringEPU37objcproto26WebAllowDenyPolicyListener11objc_objectP8UIWindow + 169
8 WebKit 0x00007fff2d123641 -[WKGeolocationProviderIOS(WebGeolocationCoreLocationUpdateListener) geolocationAuthorizationGranted] + 603
9 WebKit 0x00007fff2d12328d -[WKGeolocationProviderIOS
...