我想在模拟器中获取我的位置。几次它的工作,但...现在我总是得到0.000000作为我的位置。这里是我使用的代码:客观c找出我的位置?
#import <CoreLocation/CoreLocation.h>
CLLocationManager *locationManager = [[CLLocationManager alloc] init];
[locationManager startUpdatingLocation];
CLLocation *location = [locationManager location];
CLLocationCoordinate2D coordinate = [location coordinate];
NSLog(@"%f",location.coordinate.latitude);
NSLog(@"%f",location.coordinate.longitude);
运行应用程序,我在模拟器调试改变后 - >位置 - >自定义位置...是否有人可以解释为什么它停止工作?
你的委托方法在哪里? – matt