locationServicesEnabled always return YES

后端 未结 6 1490
臣服心动
臣服心动 2021-02-03 10:28

I tested my device (iPod Touch 2G iOS 4.1) if location services are enabled

permitted = [locationManager locationServicesEnabled];

and I always

6条回答
  •  失恋的感觉
    2021-02-03 11:16

    When you implement the delegate for location manager, you should be implementing didFailWithError. In there you will get the appropriate error if the user did not allow access to location

    Apple Documentation States: If the user denies your application’s use of the location service, this method reports a kCLErrorDenied error. Upon receiving such an error, you should stop the location service.

提交回复
热议问题