我想获取当前位置,可以看到此代码,但是单击按钮时如何分配此经纬度以进行标签?

-(void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation   *)newLocation fromLocation:(CLLocation *)oldLocation {

    NSLog(@"latitudeAAAAA %f",newLocation.coordinate.latitude );
    NSLog(@"longitudeAAAA %f",newLocation.coordinate.longitude);
    [corelocation stopUpdatingLocation];
}

最佳答案

label.text = [NSString stringWithFormat:@"%lf,%lf", newLocation.coordinate.latitude, newLocation.coordinate.longitude];

关于iphone - 得到当前的纬度和经度,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/7611704/

10-11 15:46