I am using iPhone sdk 4.0. I used the code below to determine the current location, but its delegation methods are not called automatically ... My code is below:
in .hfile
I have import
CoreLocation/CoreLocation.h
also delegate
CLLocationManagerDelegate
CLLocationManager *locationManager;
in .mfile
locationManager = [[CLLocationManager alloc] init];
locationManager.delegate = self;
locationManager.distanceFilter = kCLDistanceFilterNone;
locationManager.desiredAccuracy = kCLLocationAccuracyHundredMeters;
[locationManager startUpdatingLocation];
but I do not get the current location for this ...... My delegation method, which is not called:
- (void)locationManager:(CLLocationManager *)manager
didUpdateToLocation:(CLLocation *)newLocation
fromLocation:(CLLocation *)oldLocation
{
}
source
share