【问题标题】:CLLocationManager delegate method is not called in iOS4iOS4 中不调用 CLLocationManager 委托方法
【发布时间】:2011-03-12 18:48:51
【问题描述】:

我目前正在使用地图功能,我得到了当前位置并显示出来。现在我在 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];

}

请帮帮我。

谢谢。

【问题讨论】:

    标签: ios4 delegates cllocationmanager


    【解决方案1】:

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

    Xcode 3.1.3 之前也报告过此问题。但从现在开始我一直在模拟器上使用 3.1.2。 当我更新到 iOS4 时,出现了这个问题。很烦人……

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-12-03
      • 1970-01-01
      • 2011-11-18
      • 2016-05-12
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多