views:

158

answers:

1

Hi!I am using iPhone sdk 4.0.I have used below code for taking Current location but it's delegate methods is not called Automatically...My code is given 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; // whenever we move
locationManager.desiredAccuracy = kCLLocationAccuracyHundredMeters; // 100 m
[locationManager startUpdatingLocation];

but i don't get the current location for that......My Delegate Method is which is not called:

  • (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation {
A: 

Hi I am having the same problem. How did you resolve this problem? Amitabh

Amitabh
in sdk 4.0 when you run your code in simulator it will not take value but when u run in device it will defiantly work.
Ankit Vyas
I am not getting callbacks on Sim ***or*** device. Not on iPod touch, not on iPhone. It's driving me bonkers!
Olie