1
我目前正在使用Map功能,并获取当前位置并显示。现在,我在iOS4中运行我的应用程序。在iOS4中运行应用程序时,无法调用委托方法。但是我可以在旧版本的Xcode 3.1.4中运行我的应用程序。它工作正常,委托方法也正确调用。那么我怎样才能在iOS4中调用CLLocationManger委托方法?它对我来说很奇怪。CLLocationManager委托方法不在iOS4中调用
- (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];
}
请帮我一把。
谢谢。