Welcome to the Treehouse Community
Looking to learn something new?
Brandon Jonas13,387 Points
Problem with CLLocation: Longitude and Latitude registering as 0.000
There is an issue with my iOS application in finding the location in longitude and latitude where it is registering as longitude 0.000 and latitude 0.000 when trying to get the location.
self.locationManager = [[CLLocationManager alloc]init];
self.locationManager.delegate = self;
self.locationManager.desiredAccuracy = kCLLocationAccuracyBest;
self.locationManager.distanceFilter = 30; // Meters.
I call these lines in my viewDidLoad method and I have implemented a didUpdateLocations method
- (void)locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray *)locations
self.location = locations.lastObject;
For some reason this method is never being called. I have linked the delegate to my interface and have created properties for my CLLocationManager and CLLocation. I have tried running the code in the simulator and on an iPhone with the same result.
Alejandra H BernalCourses Plus Student 4,667 Points
I have the same problem, it works in Xcode 5, but locationManager:didUpdateLocations: is never called in Xcode 6. It also happens with the last project file that I downloaded from the last video of the Diary App.
Thomas Nilsen14,957 Points
Can you share the project through a dropbox link or something so I can have a look? :)