0

Like everyone else when they upgraded to iOS8 their CLLocationManager apps began to not work. I have read around the subject and think I have applied the fixes but the locationManager is still not being called. I have clearly missed something out....

#define IS_OS_8_OR_LATER ([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0)

- (void)viewDidLoad {
    [super viewDidLoad];
    locationManager = [[CLLocationManager alloc] init];
    locationManager.desiredAccuracy = kCLLocationAccuracyBest;
    locationManager.delegate = self;
    locationManager.desiredAccuracy = kCLLocationAccuracyNearestTenMeters;
    locationManager.distanceFilter = 10;
    if(IS_OS_8_OR_LATER) {
        [locationManager requestAlwaysAuthorization];
        NSLog(@"iOS8");        
    }
    [locationManager startUpdatingLocation]; }
Edward Hasted
  • 3,201
  • 8
  • 30
  • 48
  • You could find an answer [on StackOverflow](http://stackoverflow.com/questions/24062509/ios-8-location-services-not-working) – Thorax Oct 13 '14 at 12:23

1 Answers1

0

Additionally it appears you need to add one or both string entries to plist.info. Without these you won't get any errors and it just won't work period.

NSLocationWhenInUseUsageDescription and NSLocationAlwaysUsageDescription

And hey presto everything will work. There is a very good explanation at

http://nevan.net/2014/09/core-location-manager-changes-in-ios-8/

Edward Hasted
  • 3,201
  • 8
  • 30
  • 48