i am created new project in Xcode6 and added the old files to this project(old files is created in xcode5) ,But whats happening is everything working fine, but "didUpdateToLocation" delegate method is not calling, i also used "didUpdateLocations" delegate method but both are not working.Code i have used from old file but the core location framework has been added from xcode6 ,I don't know what i am missing please anyone guide me to get a solution.
If you're testing this on iOS 8 device / Simulator, old location code may not work because of the way the iOS 8 handles Location Services permission access. As of current iOS 8 beta, you need to use new -requestWhenInUseAuthorization
method:
- (void)updateCurrentLocation {
if ([self.locationManager respondsToSelector:@selector(requestWhenInUseAuthorization)]) {
[self.locationManager requestWhenInUseAuthorization];
}
[self.locationManager startUpdatingLocation];
}
The user prompt contains the text from the NSLocationWhenInUseUsageDescription
key in your app’s Info.plist file, and the presence of that key is required when calling this method.
<key>NSLocationWhenInUseUsageDescription</key>
<string>We use your location to find places near you.</string>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With