Iphone GPS does not give exact latitude and longitude

Hi friend, I saw a lot of reports about the accuracy problem with gps, but it doesn't work all the time

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

    NSString  *latstr = [NSString stringWithFormat:@"%f", newLocation.coordinate.latitude];
    NSString  *longstring=[NSStringstringWithFormat:@"%f",newLocation.coordinate.longitude];

     if (abs(howRecent)>5.0)
     {
         [self.locationManager startUpdatingLocation];
         return;
      }
    if(abs(newLocation.horizontalAccuracy)<0.0f)
    {
        [self.locationManager startUpdatingLocation];
        return;
    }
    if(newLocation.horizontalAccuracy>65.0f)
    {
        [self.locationManager startUpdatingLocation];
        return;
    }
    self.latstring = [latstr copy];
    self.longstr = [longstring copy];

    if((updateLocationFirst||loadFirstView))
    {    
        [[NSUserDefaults standardUserDefaults]setObject:latstring forKey:@"Latitude"];
        [[NSUserDefaults standardUserDefaults]setObject:longstr forKey:@"Longitude"];
        [self displayParticularDaySpecial];
        loadFirstView=FALSE;
        updateLocationFirst=FALSE;
        [self.locationManager stopUpdatingLocation];
    }
}

The problem here is that I am sending latitude and longitude to the google api with respect to some addresses, if I decrease the accuracy value by spending a lot of time downloading, and this value has a problem when you reach the destination with respect to the destination with a difference of 0.6 miles.

+5
source share
2 answers

You should refer to the โ€œLocation Programming Guideโ€ , which provides excellent programming examples to determine your location.

, , , , , ( , , ). didUpdateLocations , . ... , . , didUpdateLocations, , .

, didUpdateToLocation. iOS 6, didUpdateLocations, CLLocationManagerDelegate.

, , . . , , ( ). , , , , .

+2

targetLocationAccuracy CLLocationManager? .

, .

+1

All Articles