-1
我已经使用Core位置框架在我的IPOD中接收我的GPS坐标。首先我可以获取经度和纬度,然后我收到一条错误消息,kCLErrorDomain Code = 0操作无法完成。CoreLocation框架问题
但错误信息从未change.I想到第一次只是它的工作原理
这是我的代码
#import "CoreLocationDemoViewController.h"
@implementation CoreLocationDemoViewController
@synthesize CLController;
- (void)viewDidLoad {
[super viewDidLoad];
CLController = [[CoreLocationController alloc] init];
CLController.delegate = self;
[CLController.locMgr startUpdatingLocation];
}
- (void)locationUpdate:(CLLocation *)location {
speedLabel.text = [NSString stringWithFormat:@"SPEED: %f", [location speed]];
latitudeLabel.text = [NSString stringWithFormat:@"LATITUDE: %f", location.coordinate.latitude];
longitudeLabel.text = [NSString stringWithFormat:@"LONGITUDE: %f", location.coordinate.longitude];
altitudeLabel.text = [NSString stringWithFormat:@"ALTITUDE: %f", [location altitude]];
errorLabel.text = @"";
}
- (void)locationError:(NSError *)error {
if(!CLController) //.text)
{
errorLabel.text = [error description];
}
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation {
return YES;
}
- (void)viewDidUnload {
}
- (void)dealloc {
[CLController release];
[super dealloc];
}
@end
任何人都知道什么是问题,帮助表示高度赞赏。
感谢, VKS
请将代码标记为代码。这几乎不可读。 –
@ vks,你不能在Ipod中获得当前位置。因为Ipod没有GPS设备。 – Sisu
但我第一次得到正确的GPS坐标,然后得到了错误信息,我的iPod有WiFi连接 – vks