WKWebView线程1:使用位置时发出信号SIGABRT

问题描述 投票:0回答:1

我是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,所以我不知道如何解决此问题。

javascript ios swift xcode wkwebview
1个回答
0
投票

我也是,这很烂。

 *** 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
...
© www.soinside.com 2019 - 2024. All rights reserved.