2010-01-21 51 views

回答

2

如果你不想要地圖,你不需要MapKit。只需使用CLLocationManager

- (id) init { 
    if (self = [super init]) { 
    locationManager = [[CLLocationManager alloc] init]; 
    [locationManager setDelegate:self]; 
    [locationManager startUpdatingLocation]; 
    } 
    return self; 
} 

- (void) locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)location fromLocation:(CLLocation *)oldLocation { 
    NSLog(@"lat:%f lon:%f", location.coordinate.latitude, location.coordinate.longitude); 
}