我想收到的坐标用户当前的位置,我进入了这个代码:用户当前位置
-(void)update{
locationManager = [[CLLocationManager alloc] init];
locationManager.distanceFilter = kCLDistanceFilterNone; // whenever we move
locationManager.desiredAccuracy = kCLLocationAccuracyBest;
locationManager.delegate = self;
mapView.showsUserLocation = YES;
[locationManager startUpdatingLocation];
}
在iOS模拟器,该代码崩溃,我的设备是不是有时它崩溃了整个应用程序....你能帮助我发生什么事吗?
你是什么意思的“它是失败”在模拟器上? “你的整个应用程序失败”是什么意思?你能描述你遇到的崩溃/错误吗? – Rob
该模拟器不能提供整个gps expereince。它具有提供位置的基本功能。例如。在这里:http://stackoverflow.com/questions/12641817/ios-simulator-and-gps –
请更清楚一点不工作。你期待什么,没有发生什么? – Daniel