开发者

iPod touch reports incorrect location

I have borrowed my friend's first gen iPod touch to test my app on. I upgra开发者_如何转开发ded the OS to iOS 3.1.3.

I have been following the big nerd ranch book and am trying to get the location to display in the log, but it's inside a view rather than the app delegate.

The location is reported but for some reason it gives her address, over 300 miles away....

The separate maps app reports that it cannot determine my location

I turned the geolocation services on and off and I can only find my home network listed so I can't make the device forget her network.

Here is the code i am using:

- (void)viewDidLoad
{
    [super viewDidLoad];

    locationManager = [[CLLocationManager alloc] init];

    [locationManager setDelegate:self];

    [locationManager setDistanceFilter:kCLDistanceFilterNone];

    [locationManager setDesiredAccuracy:kCLLocationAccuracyBest];

    [locationManager startUpdatingLocation]; 
}




-(void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation
{
   NSLog(@"%@", newLocation);
}

What am I doing wrong?

EDIT: I am connected to my home network 300 miles from hers

also the log result is:

 <anumber,anumber>+/- 144.27m (speed -1.00 mps / course -1.00) @ 2009-06-28 17:58:08 +0100

It seems to think it is 2009...

thanks everyone


Looks like it's using a cached location, and in the place you are now it can't get a location fix. Try testing it again in a place with lots of WiFi (a city/big suburb). Also, check to see if you can find a location in the maps app.


Well there is nothing wrong, the iPod touch does not have a GPS chip. It uses triangulation of WiFi ESSID to vindt it's location.

It will need a network connection to do this correctly.


There was this one time when the timezone on the WiFi router was set incorrectly and that kind of screwed up location info on iPods.

Check your router settings.


Do you have an iPhone?

  • Make sure the GPS is on (run maps for a bit, small accuracy circle around the blue dot).
  • Make sure it can see your WiFi network (join it).

Maybe try this with another iPhone also.

Sync the devices with iTunes, and hope that Apple's location/ESSID database is updated by those iPhones at some time in the near future :)

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜