title: How to find your current location with CoreLocation
body: <p>I need to find my current location with <code>CoreLocation</code>, I tried multiple methods but so far my <code>CLLocationManager</code> has only returned 0's.. (<code>0.000.00.000</code>).</p>
  
  <p>Here's my code (<strong>updated to work</strong>):</p>
  
  <p><em>Imports</em>:</p>
  
  <pre><code>#import &lt;CoreLocation/CoreLocation.h&gt;
  </code></pre>
  
  <p><em>Declared</em>:</p>
  
  <pre><code>IBOutlet CLLocationManager *locationManager;
  IBOutlet UILabel *latLabel;
  IBOutlet UILabel *longLabel;
  </code></pre>
  
  <p><em>Functions</em>:</p>
  
  <pre><code>- (void)getLocation { //Called when needed
      latLabel.text  = [NSString stringWithFormat:@"%f", locationManager.location.coordinate.latitude]; 
      longLabel.text = [NSString stringWithFormat:@"%f", locationManager.location.coordinate.longitude];
  }
  
  - (void)viewDidLoad {
      locationManager = [[CLLocationManager alloc] init];
      locationManager.distanceFilter = kCLDistanceFilterNone; // whenever we move
      locationManager.desiredAccuracy = kCLLocationAccuracyHundredMeters; // 100 m
      [locationManager startUpdatingLocation];
  }
  </code></pre>