【发布时间】:2011-09-02 08:32:44
【问题描述】:
location = [[CLLocationManager alloc] init];
location.desiredAccuracy = kCLLocationAccuracyBestForNavigation ;
location.distanceFilter = 10 ;
location.delegate=self;
locationEnabledBool = [CLLocationManager locationServicesEnabled];
if (locationEnabledBool ==NO) {
UIAlertView *locationAlert = [[UIAlertView alloc] initWithTitle:@"Location Service Disabled"
message:@"To re-enable, please go to Settings and turn on Location Service for this app."
delegate:nil
cancelButtonTitle:@"OK"
otherButtonTitles:nil];
[locationAlert show];
[locationAlert release];
}
else
[location startUpdatingLocation];
locationEnabledBool 的值始终为YES,与是否启用定位服务无关。任何身体都可以帮忙吗?
【问题讨论】: