locationServicesEnabled always return YES

后端 未结 6 1507
臣服心动
臣服心动 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 10:52

    When you use

    [CLLocationManager locationServicesEnabled]
    

    then you inspect if locationServices are enabled in whole system. So when you go to Settings -> Location Services and you see that first switch. That method returns state of that state and is not in relation with your app.

    If you need to know if your app has access to location services use @Pascalius answer.

提交回复
热议问题