3

I have a project made using Xcode 5. I have a ViewController where i take the phone location using a CLLocationManager. I have implemented both:

-(void)locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray *)locations
-(void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *)error

which worked great.

Now i opened the project with Xcode 6 GM, and neither of these 2 methods where called (not on simulator, or device).

Any ideas? Thanks

Alin
  • 101
  • 1
  • 9
  • Hi, Xcode 6 hasn't been publicly available and it is only for developers. You should ask any question regarding iOS8 or Xcode 6 in Apple dev forum till they are publicly released. – Maziyar Sep 15 '14 at 09:11
  • 1
    Have you implemented one of the new authorisation calls - `requestAlwaysAuthorization` or `requestWhenInUseAuthorization`? You also need the appropriate entries in the info.plist - See this answer, for example http://stackoverflow.com/questions/24062509/ios-8-location-services-not-working/24063578#24063578 – Paulw11 Sep 15 '14 at 09:19
  • possible duplicate of [iOS 8 : Location Services not working](http://stackoverflow.com/questions/24062509/ios-8-location-services-not-working) – Paulw11 Sep 15 '14 at 09:20
  • It solved my problem. http://datacalculation.blogspot.in/2014/11/how-to-fix-cllocationmanager-location.html – iOS Test Nov 02 '14 at 17:23
  • Click on a location, then click off. Then click on one again. It should work. – noobsmcgoobs Feb 04 '15 at 05:05

1 Answers1

6

Please check the thread here

You have to take care of two things

1.

  • requestAlwaysAuthorization - for background location

    [self.locationManager requestWhenInUseAuthorization];or

  • requestWhenInUseAuthorization-location only when app is active

    [self.locationManager requestAlwaysAuthorization];

If you do not make either of two request , iOS will ignore startUpdateLocation request.

2. Include NSLocationAlwaysUsageDescription or NSLocationWhenInUseUsageDescription key in Info.plist depending upon which permission you are asking for. This string will be diaplayed by iOS to user so the user can get excat idea why does our app needs permission.

Hope this helps.

Community
  • 1
  • 1
Bhumit Mehta
  • 16,278
  • 11
  • 50
  • 64
  • 1
    I got some more description at http://datacalculation.blogspot.in/2014/11/how-to-fix-cllocationmanager-location.html – iOS Test Nov 02 '14 at 17:22