views:

164

answers:

4

Hi Buddies,

I am currently working in Map and i find the current location in my application and displayed. Now i am working with iOS4. So the CLLocationManger delegate method is not calling in iOS4. But i could run my application in older version of Xcode 3.1.4. it works fine and delegate method also called properly. So how can i call the CLLocationManger delegate method in iOS4? Its very weird to me.

  - (void)locationManager: (CLLocationManager *)manager didUpdateToLocation: (CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation

{

 NSLog(@"inside didUpdateToLocation");

 MKCoordinateRegion region1;

 region1.center = newLocation.coordinate;

 region1.span.latitudeDelta = 0.001;

 region1.span.longitudeDelta = 0.001;

 mapview.mapType = MKMapTypeStandard;

 [mapview setRegion:region1 animated:TRUE];

 [locationManager stopUpdatingLocation];

}

Please help me out.

Thanks.

A: 

I have the same problem too.

I also had to add the CLLocationManagerDelegate to make is compile OK. In the Device a get the CLLocation and Map updates region. In the simulator i can't get it to work. Searched all over the inet. No solution available yet. If i see any solution in the apple development forum i ll be back to post it here.

teliaz
A: 

Turned On the Airport and seems to work OK now. Very Weird....

This was also reported before for Xcode 3.1.3. but since now I always used 3.1.2 on Simulator. When I updated to iOS4 this issue appeared. Very annoying....

teliaz
A: 

CLLocationManager delegate method is not called when it fails the get a location. When an error occurs, the method didFailWithError is called instead.

Some issues with the simulator have been reported here and here

albertamg
A: 

My Airport is on and it still doesn't work.

If it ain't broken, why fix it?!

It's really annoying, anyone knows what to do?

Noam