CLLocationManagerDelegate method not calling in iPodTouch
Posted
by Siddharth
on Stack Overflow
See other posts from Stack Overflow
or by Siddharth
Published on 2010-06-18T14:47:08Z
Indexed on
2010/06/18
16:23 UTC
Read the original article
Hit count: 322
iphone
|objective-c
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];
}
© Stack Overflow or respective owner