【问题标题】:Why does CLLocationManager returns null locations on the iphone SDK 4 beta in the Simulator?为什么 CLLocationManager 在模拟器中的 iphone SDK 4 beta 上返回空位置?
【发布时间】:2010-06-14 20:48:10
【问题描述】:

我有这段代码:

- (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation
{
    NSLog(@"Manager did update location!!");
    self.currentLocation = newLocation.description;
}

我在符合CLLocationManagerDelegate 的类中有这段代码。我早些时候在 sdk 3.0 中测试过并且效果很好(在模拟器和设备上)。我正在模拟器中的 SDK 4 上测试这个类,但它提供了 null 作为新位置。我什至无法获得第一次通话的 NSLog。我检查了我使用位置框架的其他应用程序,但它也不起作用。

我还实现了locationManager:didFailWithError: 消息,它从未被调用过。

任何人都可以确认模拟器不能执行任何 CLLocationManager 功能吗? (将错误报告为已知问题的链接将很棒)。有没有办法解决这个问题?

提前致谢。

-更新:我在新的 SDK4 GM 版本上对此进行了测试,但仍然无法正常工作。

【问题讨论】:

    标签: iphone geolocation cllocationmanager ios4


    【解决方案1】:

    您不能在 Apple 开发者网站之外讨论 SDK 4,直到它完成测试版并向公众发布。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-01-04
      • 1970-01-01
      • 1970-01-01
      • 2011-03-04
      • 2010-12-06
      相关资源
      最近更新 更多