Currently using Xcode 6;
While generating map view in iOS 8.1 using Mapkit.h and coreLocation framework,on clicking the button instead of showing latitude and longitude values in labels it's showing crash error as:unrecognized selector sent to instance 0x797a4e20
in GPSController.m
- (IBAction)tap:(id)sender {
NSLog(@"button clicked");
locationManager.delegate = self;
locationManager.desiredAccuracy = kCLLocationAccuracyBest;
[locationManager startUpdatingLocation];
[locationManager startMonitoringSignificantLocationChanges];
}
should fetch the value in this:
(void)locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray *)locations
{
NSLog(@"location info object=%@", [locations lastObject]);
CLLocation* location = [locations lastObject];
NSLog(@"latitude %+.6f, longitude %+.6f\n",
location.coordinate.latitude,
location.coordinate.longitude);
self.lat.text = [NSString stringWithFormat:@"%+.6f", location.coordinate.latitude];
self.longi.text = [NSString stringWithFormat:@"%+.6f", location.coordinate.longitude];
[self performSegueWithIdentifier:@"Map" sender:self];
}