使用CLLocationManager这个类 实现代理方法 - (void)locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray *)locations { CLLocation *location = [locations lastObject]; CLLocationDegrees latitude = location.coordinate.latitude; CLLocationDegrees longitude = location.coordinate.longitude; //some code }
使用
CLLocationManager
这个类实现代理方法