在我的头,我把CLLocationManager是给老位置
CLLocationManager *locationManager;
@property (nonatomic, retain) CLLocationManager *locationManager;
在我的实现文件:
- (void)viewDidLoad
{
self.locationManager = [[[CLLocationManager alloc] init] autorelease];
self.locationManager.distanceFilter = 50.0f;
[self.locationManager setDesiredAccuracy:kCLLocationAccuracyNearestTenMeters];
self.locationManager.delegate = self;
[locationManager startUpdatingLocation];
[super viewDidLoad];
}
的委托方法
- (void)locationManager:(CLLocationManager *)manager
didUpdateToLocation:(CLLocation *)newLocation
fromLocation:(CLLocation *)oldLocation
{
NSLog(@"Location: %g,%g", newLocation.coordinate.latitude, newLocation.coordinate.longitude);
}
现在我不断收到老
然后经度和纬度值
用Google搜索的解决方案我无法找到任何,我不明白我在做什么错,
任何帮助,请
这是在设备上还是模拟器? – 2011-06-05 18:58:50