title: Get user location in a simple ViewController in iOS 7 (didUpdateLocation)
body: <p>How can I get the user Location in a simple ViewController in iOS 7?
  I have tried in this way, but on debugging I saw that <code>didUpdateLocation</code> method isn't called:</p>
  
  <p>In MyViewController.h:</p>
  
  <pre><code>#import &lt;CoreLocation/CoreLocation.h&gt;
  @interface MyViewController : UIViewController &lt;CLLocationManagerDelegate&gt;
  {
      CLLocationManager *locationManager;   
  }
  </code></pre>
  
  <p>In MyViewController.m</p>
  
  <pre><code>- (void)viewDidLoad
  {
      [super viewDidLoad];
      locationManager = [[CLLocationManager alloc] init];
      locationManager.delegate = self;
      //locationManager.distanceFilter = kCLDistanceFilterNone; // whenever we move
      locationManager.desiredAccuracy = kCLLocationAccuracyHundredMeters; // 100 m
      [locationManager startUpdatingLocation];
  }
  
  - (void)locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray *)locations{
      CLLocation *newLocation = [locations lastObject];
      NSLog(@"NewLocation %f %f", newLocation.coordinate.latitude, newLocation.coordinate.longitude);
  }
  
  - (void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *)error
  {
      NSLog(@"Failed %ld",(long)[error code]);
  
  }
  </code></pre>
  
  <p><code>didUpdateLocations</code> isn't called, but is called <code>didFailWithError</code> printing in log: "Failed 0". Please help me!</p>