Error Domain=kCLErrorDomain Code=2 “The operation couldn’t be completed. (kCLErrorDomain error 2.)”

后端 未结 2 2000
情歌与酒
情歌与酒 2020-12-19 09:51
import UIKit
import CoreLocation

class ViewController: UIViewController, CLLocationManagerDelegate {

    @IBOutlet var latLabel: UILabel!
    @IBOutlet var longLab         


        
相关标签:
2条回答
  • 2020-12-19 10:14

    Alternatively, you can pass lat long to this google api and get all fields related to address depending on the "types" in the json

    0 讨论(0)
  • 2020-12-19 10:31

    That's a network error, CLGeocoder needs a working network connection in order to reverse geocode a location, according to the docs.

    Also, CLGeocoder will throttle geocoding requests, returning that same error if you exceed the request rate, this is also documented in the class reference.

    0 讨论(0)
提交回复
热议问题