【问题标题】:CLLocationManager seems unable to update my location more than onceCLLocationManager 似乎无法多次更新我的位置
【发布时间】:2011-02-02 13:04:58
【问题描述】:

基本上,我遵循“Big Nerd Ranch 指南 - iPhone 编程”并尝试尽可能频繁地在控制台上输出位置。在我的计算机上运行它时,我得到以下输出:

[Session started at 2011-02-02 12:55:41 +0000.]
2011-02-02 12:55:42.884 Whereami[17833:207] <+51.51773825, -0.15769391> +/- 51.00m (speed -1.00 mps / course -1.00) @ 1/22/11 12:12:30 PM Greenwich Mean Time
2011-02-02 12:56:22.882 Whereami[17833:207] Could not find location: Error Domain=kCLErrorDomain Code=0 "The operation couldn’t be completed. (kCLErrorDomain error 0.)"
2011-02-02 12:57:10.883 Whereami[17833:207] Could not find location: Error Domain=kCLErrorDomain Code=0 "The operation couldn’t be completed. (kCLErrorDomain error 0.)"

但是当我在其他人的计算机上运行它时,它可以正常工作并不断更新位置。我认为这一定是设置问题(所以没有显示任何代码)。如果有人能弄清楚为什么它不能在我的计算机上运行,​​但可以在其他计算机上运行(或至少为我指明正确的方向),那就太好了。

谢谢

【问题讨论】:

    标签: iphone cllocationmanager


    【解决方案1】:

    我不熟悉该指南,但我已经实现了 CLLocationManager。我的经历是相似的,当我在我的电脑上运行代码时,位置似乎没有更新——但我确实发现如果我等待几分钟它有时会起作用——最终它会找到苹果的总部;)。在我的手机上运行的相同代码确实按预期工作。另一个问题是,根据您选择执行此操作的方式(您没有提供相关代码),如果找不到新的或更好的位置,位置管理器可能会选择不提供更新。帮不上忙,抱歉。

    【讨论】:

      猜你喜欢
      • 2016-01-09
      • 2012-03-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-12-29
      • 2015-06-07
      • 1970-01-01
      相关资源
      最近更新 更多