Sekhar Bhetalam
Sekhar Bhetalam

Reputation: 4545

CLLocationManger: Did update location is not being called

I am implementing location based application.In my application I am using the following methods.

  - (void)locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray *)locations


  -(void)locationManager:(CLLocationManager *)manager didUpdateHeading:(CLHeading *)newHeading

And the following is my code in ViewDidLoad

 - (void)viewDidLoad 
{
    [super viewDidLoad];

    self.mapView.showsUserLocation = YES;

    self.locationManager=[[CLLocationManager alloc] init];
    self.locationManager.desiredAccuracy = kCLLocationAccuracyBest;
    self.locationManager.delegate=self;

    [self.locationManager startUpdatingHeading];
}

Here my problem is didUpdateHeading method is being called but not didUpdateLocations.And I checked there is delete. Can any one help me out from this?

Upvotes: 0

Views: 383

Answers (1)

Craig
Craig

Reputation: 8304

You've called startUpdatingHeading so you get heading updates, you didn't call startUpdatingLocation so you don't get location updates.

Upvotes: 2

Related Questions