Why the CLLocationManager delegate is not getting called in iPhone SDK 4.0 ???
Posted
by Biranchi
on Stack Overflow
See other posts from Stack Overflow
or by Biranchi
Published on 2010-06-17T04:45:34Z
Indexed on
2010/06/17
4:53 UTC
Read the original article
Hit count: 751
Hi,
This is the code that I have in my AppDelegate Class
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
CLLocationManager *locationManager = [[CLLocationManager alloc] init];
locationManager.delegate = self;
locationManager.distanceFilter = 1000; // 1 Km
locationManager.desiredAccuracy = kCLLocationAccuracyKilometer;
[locationManager startUpdatingLocation];
}
And this is the delegate method i have in my AppDelegate Class
//This is the delegate method for CoreLocation
- (void)locationManager:(CLLocationManager *)manager
didUpdateToLocation:(CLLocation *)newLocation
fromLocation:(CLLocation *)oldLocation
{
//printf("AppDelegate latitude %+.6f, longitude %+.6f\n", newLocation.coordinate.latitude, newLocation.coordinate.longitude);
}
Its working in 3.0, 3.1, 3.1.3 , but its not working in 4.0 simulator and device both.
What is the reason ??
I am getting frustrated ......
Thanks....
© Stack Overflow or respective owner