title: Getting Longitude/Latitude of the User When the viewDidLoad
body: <p>My purpose is to get the longitude/latitude of the user when the view is loaded and to store the values in two variables for later calculations. I don't need to track the user location and to update it, I simply need to get his/her coordinates <strong>once</strong>.  My code looks like this:</p>
  
  <pre><code>- (void)viewDidLoad {
      [super viewDidLoad];
      // locationManager update as location
      locationManager = [[CLLocationManager alloc] init];
      locationManager.delegate = self; 
      locationManager.desiredAccuracy = kCLLocationAccuracyBest; 
      locationManager.distanceFilter = kCLDistanceFilterNone; 
      [locationManager startUpdatingLocation];
      CLLocation *location = [locationManager location];
      // Configure the new event with information from the location
      CLLocationCoordinate2D coordinate = [location coordinate];
  
      float longitude=coordinate.longitude;
      float latitude=coordinate.latitude;
  
      NSLog(@"dLongitude : %f",longitude);
      NSLog(@"dLatitude : %f", latitude); 
  }
  </code></pre>
  
  <p>In the console i keep getting this:</p>
  
  <pre><code>dLongitude : 0.000000
  dLatitude : 0.000000
  </code></pre>
  
  <p>Can you please help me there?</p>