操作无法完成。 (MKErrorDomain错误4)

发布于 2024-09-25 11:04:45 字数 152 浏览 0 评论 0原文

我正在使用 MKReverseGeocoder,但我不断收到verseGeocoder:didFailWithError:“操作无法完成。(MKErrorDomain 错误4。)”。我向地理编码器传递 MKUserLocation 注释的坐标。这个错误是什么意思&我怎样才能避免它?

I am using the MKReverseGeocoder but I keep getting reverseGeocoder:didFailWithError: "The operation couldn’t be completed. (MKErrorDomain error 4.)". I am passing the geocoder the coordinates of the MKUserLocation annotation. What does this error mean & how can I avoid it?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

网白 2024-10-02 11:04:46

实际上这个错误
调试:- 错误 操作无法完成。 (MKErrorDomain 错误 4。)
当从模拟器中清除所有最近的应用程序并重新运行它时,我得到了解决。

Actually this error of
DEBUG:- ERROR The operation couldn’t be completed. (MKErrorDomain error 4.)
I was solved when clear all recentApp's from simulator and re-run it.

删除会话 2024-10-02 11:04:45

我对类似问题的回答:

我最近遇到并解决了这个问题。就我而言,当 Apple Map 找不到任何查询结果时,它有时会抛出“MKErrorDomain = 4”错误。所以我最终只是将其视为“未找到结果”。

发现这一点是很费劲的,MapKit 需要一个更好的错误处理系统。

My answer to a similar question:

I've met and solved this issue recently. In my case, when Apple Map cannot find any result for a query, it sometimes will just throw this this "MKErrorDomain = 4" error. So I ended up just treating this as "result not found".

It was painstaking to find this out, MapKit needs a better Error handling system.

儭儭莪哋寶赑 2024-10-02 11:04:45

它记录在 https://developer.apple.com/documentation/mapkit/mkerror /代码#主题

如果您查看 MKError 的代码,您会发现 enum

public enum Code : UInt {

        
        public typealias _ErrorType = MKError

        case unknown = 1

        case serverFailure = 2

        case loadingThrottled = 3

        case placemarkNotFound = 4

        @available(iOS 7.0, *)
        case directionsNotFound = 5

        @available(iOS 13.0, *)
        case decodingFailed = 6
    }

因此 MKERRORDOMAIN error 4 只是意味着“找不到地标”。

It's documented at https://developer.apple.com/documentation/mapkit/mkerror/code#topics.

If you look into the code of MKError, you find the enum:

public enum Code : UInt {

        
        public typealias _ErrorType = MKError

        case unknown = 1

        case serverFailure = 2

        case loadingThrottled = 3

        case placemarkNotFound = 4

        @available(iOS 7.0, *)
        case directionsNotFound = 5

        @available(iOS 13.0, *)
        case decodingFailed = 6
    }

So MKERRORDOMAIN error 4 just means "placemark not found".

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文