Je dois obtenir la position et le titre. Une fois que j'ai exécuté mon code, je ne reçois que les mises à jour, l'emplacement ne se met pas à jour car il n'apparaît pas dans les journaux.Emplacement CoreLocation ne se met pas à jour lorsque l'en-tête est en cours de mise à jour
Si je désactive les mises à jour de rubrique, j'obtiens mes coordonnées de localisation. Si les mises à jour d'en-tête sont activées, je n'ai pas d'emplacement. Est-ce que quelqu'un a eu le même genre de problème?
Voici mon ensemble de routine et mes méthodes:
locationManager = [[CLLocationManager alloc]init];
locationManager.headingFilter = 1;
locationManager.delegate = self;
[locationManager startUpdatingLocation];
[locationManager startUpdatingHeading];
-(void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation// fromLocation:(CLLocation *)oldLocation
{NSString *currentLatitude = [[NSString alloc] initWithFormat:@"%g", newLocation.coordinate.latitude];
NSLog(@"currentLatitude = %@", currentLatitude);
NSString *currentLongitude = [[NSString alloc] initWithFormat:@"%g", newLocation.coordinate.longitude];
NSLog(@"currentLongitude = %@", currentLongitude);
NSString *currentHorizontalAccuracy = [[NSString alloc] initWithFormat:@"%g", newLocation.horizontalAccuracy];
NSLog(@"currentHorizontalAccuracy = %@", currentHorizontalAccuracy);
NSString *currentAltitude = [[NSString alloc] initWithFormat:@"%g", newLocation.altitude];
NSLog(@"currentAltitude = %@", currentAltitude);
NSString *currentVerticalAccuracy = [[NSString alloc] initWithFormat:@"%g", newLocation.verticalAccuracy];
NSLog(@"currentVerticalAccuracy = %@", currentVerticalAccuracy);
}- (BOOL)locationManagerShouldDisplayHeadingCalibration: (CLLocationManager *)manager {
return NO;}
-(void)locationManager:(CLLocationManager *)manager didUpdateHeading:(CLHeading *)newHeading{
CLLocationDirection trueHeading = newHeading.trueHeading;}