title: Current user location for iOS 8 - App won't launch
body: <p>I have been working on a simple app to get the users current location using the Core Location framework from Apple in Xcode and when i run the app i get an error. Can someone please tell me what i did wrong thank you in advance. I have this code here in the Implementation file.</p>
  
  <pre><code>#import "ViewController.h"
  
  @interface ViewController ()
  
  @end
  
  @implementation ViewController { CLLocationManager *locationManager;
  
  }
  
  - (void)viewDidLoad {
   [super viewDidLoad];
      // Do any additional setup after loading the view, typically   from   a nib.
  
      locationManager = [[CLLocationManager alloc] init];
  
  }
  
  
  
  - (void)didReceiveMemoryWarning {
  [super didReceiveMemoryWarning];
  // Dispose of any resources that can be recreated.
  }
  
  - (IBAction)getCurrentLocation:(id)sender {
  
  locationManager.delegate = self;
  locationManager.desiredAccuracy = kCLLocationAccuracyBest;
  
  [locationManager startUpdatingLocation];
  
  
  
  }
  
  #pragma mark - CLLocationManagerDelegate
  
  
  
  - (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation
  {
  NSLog(@"didUpdateToLocation: %@", newLocation);
  CLLocation *currentLocation = newLocation;
  
  if (currentLocation != nil) {
      _longitudeLabel.text = [NSString stringWithFormat:@"%.8f",     currentLocation.coordinate.longitude];
      _latitudeLabel.text = [NSString stringWithFormat:@"%.8f", currentLocation.coordinate.latitude];
  }
  }
  
  
  
  
  
  @end
  </code></pre>
  
  <p>This is the Header file... </p>
  
  <pre><code>#import &lt;UIKit/UIKit.h&gt;
  #import &lt;CoreLocation/CoreLocation.h&gt;
  
  @interface ViewController  : UIViewController &lt;CLLocationManagerDelegate&gt;
  
  
  @property (strong, nonatomic) IBOutlet UILabel *latitudeLabel;
  
  @property (strong, nonatomic) IBOutlet UILabel *longitudeLabel;
  
  @property (strong, nonatomic) IBOutlet UILabel *addressLabel;
  
  - (IBAction)getCurrentLocation:(id)sender;
  
  @end
  </code></pre>
  
  <p>And this is the output of the crash... </p>
  
  <pre><code>2016-01-11 11:53:58.346 current location practice[1367:32081] ***     Terminating app due to uncaught exception 'NSUnknownKeyException', 
  reason: '[&lt;ViewController 0x7ff240d80cb0&gt; setValue:forUndefinedKey:]:
   this class is not key value coding-compliant for the key getCurrentLocation.'
  *** First throw call stack:
  (
  0   CoreFoundation                      0x000000010ee29f45   __exceptionPreprocess + 165
  1   libobjc.A.dylib                     0x000000010e8a3deb objc_exception_throw + 48
  2   CoreFoundation                      0x000000010ee29b89 -[NSException raise] + 9
  3   Foundation                          0x000000010e470a6b -[NSObject(NSKeyValueCoding) setValue:forKey:] + 288
  4   UIKit                               0x000000010f36104c -[UIViewController setValue:forKey:] + 88
  5   UIKit                               0x000000010f58ea71 -[UIRuntimeOutletConnection connect] + 109
  6   CoreFoundation                      0x000000010ed6aa80 -[NSArray makeObjectsPerformSelector:] + 224
  7   UIKit                               0x000000010f58d454 -[UINib instantiateWithOwner:options:] + 1864
  8   UIKit                               0x000000010f367c16 -[UIViewController _loadViewFromNibNamed:bundle:] + 381
  9   UIKit                               0x000000010f368542 -[UIViewController loadView] + 178
  10  UIKit                               0x000000010f3688a0 -[UIViewController loadViewIfRequired] + 138
  11  UIKit                               0x000000010f369013 -[UIViewController view] + 27
  12  UIKit                               0x000000010f24251c -[UIWindow addRootViewControllerViewIfPossible] + 61
  13  UIKit                               0x000000010f242c05 -[UIWindow _setHidden:forced:] + 282
  14  UIKit                               0x000000010f2544a5 -[UIWindow makeKeyAndVisible] + 42
  15  UIKit                               0x000000010f1ce396 -[UIApplication _callInitializationDelegatesForMainScene:transitionContext:] + 4131
  16  UIKit                               0x000000010f1d49c3 -[UIApplication _runWithMainScene:transitionContext:completion:] + 1750
  17  UIKit                               0x000000010f1d1ba3 -[UIApplication workspaceDidEndTransaction:] + 188
  18  FrontBoardServices                  0x000000011219f784 -[FBSSerialQueue _performNext] + 192
  19  FrontBoardServices                  0x000000011219faf2 -[FBSSerialQueue _performNextFromRunLoopSource] + 45
  20  CoreFoundation                      0x000000010ed56011 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
  21  CoreFoundation                      0x000000010ed4bf3c __CFRunLoopDoSources0 + 556
  22  CoreFoundation                      0x000000010ed4b3f3 __CFRunLoopRun + 867
  23  CoreFoundation                      0x000000010ed4ae08 CFRunLoopRunSpecific + 488
  24  UIKit                               0x000000010f1d14f5 -[UIApplication _run] + 402
  25  UIKit                               0x000000010f1d630d UIApplicationMain + 171
  26  current location practice           0x000000010e3224bf main + 111
  27  libdyld.dylib                       0x0000000111d5892d start + 1
  )
   libc++abi.dylib: terminating with uncaught exception of type     NSException
  (lldb) 
  </code></pre>
  
  <p>Can someone please tell me what i did wrong and what i can do to fix it? Thank you. </p>