开发者

CLLocationManager seems unable to update my location more than once

Basically I am following the 'Big Nerd Ranch Guide - iPhone Programming' and trying to simply get the location to be output on the console as frequently as possible. When running it on my computer I get the following output:

[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-0开发者_运维知识库2-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.)"

But when I run it on someone else's computer it works fine and continually updates the location. I assume it must be a problem with the settings instead (so haven't shown any code). If anyone can work out why it wouldn't work on my computer but will on others (or at least point me in the right direction) that would be great.

Thanks


I'm not familiar with the guide but I have implemented the CLLocationManager. My experience was similar, when I run the code on my computer, the location didn't seem to update - but I did find that it would work sometimes if I waited a couple of minutes - eventually it would find Apple's headquarters ;). The same code running on my phone did work as expected. Another problem is, depending on how you chose to do this (you didn't provide relevant code), the location manager may choose not to provide updates if it cannot find a new or better location. Not much help, sorry.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜