HI all,
I was using a sample code which uses CLLocationManager class to determine the current location of user.
when i run this app on iPad i am getting the correct location but when i run the same app on iPod Touch i am getting a blank label i.e nothing is displayed on the label .although wi-fi signal strength is good in both iPod and iPad.The code looks like…
- (void)locationManager:(CLLocationManager *)manager
didUpdateToLocation:(CLLocation *)newLocation
fromLocation:(CLLocation *)oldLocation{
int degrees = newLocation.coordinate.latitude;
double decimal = fabs(newLocation.coordinate.latitude - degrees);
int minutes = decimal * 60;
double seconds = decimal * 3600 - minutes * 60;
NSString *lat = [NSString stringWithFormat:@"%d° %d' %1.4f\"",
degrees, minutes, seconds];
latLabel.text = lat;
[latLocationArray addObject:lat];
degrees = newLocation.coordinate.longitude;
decimal = fabs(newLocation.coordinate.longitude - degrees);
minutes = decimal * 60;
seconds = decimal * 3600 - minutes * 60;
NSString *longt = [NSString stringWithFormat:@"%d° %d' %1.4f\"",
degrees, minutes, seconds];
longLabel.text = longt;
[longLocationArray addObject:longt];
}
It’s possible that the iPad is seeing WiFi stations that the iPod Touch can’t see. The Touch has a smaller WiFi range. Are you testing in an area with very few WiFi stations (the countryside).
Is the iPad a 3G model? If it is, it will use GPS and cell towers if WiFi isn’t working.
Have you checked any errors that the location manager is sending back to you? You might have disabled location data for the app previously, or there may be some other error.