草庐IT

displayedCity

全部标签

iphone - CLGeocoder reverseGeocodeLocation "kCLErrorDomain error 2"

我正在开发具有反向地理编码功能的iOS应用程序。当我第一次调用该函数时,一切都很好。第二次调用后(使用完成调用的Controller的新实例)出现“Domain=kCLErrorDomainCode=2”错误。这发生在模拟器和设备上。坐标有效。我的代码:CLGeocoder*geoCoder=[[CLGeocoderalloc]init];CLLocation*loc=[[CLLocationalloc]initWithLatitude:cityCoords.latitudelongitude:cityCoords.longitude];self.displayedCity=[[Sta