如题,获取当前的经纬度,只要经纬度数据,不需要mapView
使用CLLocationManager
这个类
实现代理方法
- (void)locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray *)locations {
CLLocation *location = [locations lastObject];
CLLocationDegrees latitude = location.coordinate.latitude;
CLLocationDegrees longitude = location.coordinate.longitude;
//some code
}