1

我目前正在使用地图功能,我得到当前位置并显示。现在我在 iOS4 中运行我的应用程序。在 iOS4 中运行应用程序时,CLLocationManger 委托方法未调用。但我可以在旧版本的 Xcode 3.1.4 中运行我的应用程序。它工作正常,委托方法也被正确调用。那么如何在 iOS4 中调用 CLLocationManger 委托方法呢?这对我来说很奇怪。

- (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];

}

请帮帮我。

谢谢。

4

1 回答 1

0

打开机场,现在似乎工作正常。很奇怪....

这也曾在 Xcode 3.1.3 中被报道过。但从现在开始我一直在模拟器上使用 3.1.2。当我更新到 iOS4 时,出现了这个问题。很烦人....

于 2010-07-08T20:55:23.443 回答