在我的頭,我把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