我在寫單元測試,我想用CLLocationManager locationServicesEnabled
設置ON和OFF進行測試,而不必更改模擬器上的設置。ios turn locationServicesEnabled off代碼
有沒有辦法在代碼中設置locationServicesEnabled
?
我在寫單元測試,我想用CLLocationManager locationServicesEnabled
設置ON和OFF進行測試,而不必更改模擬器上的設置。ios turn locationServicesEnabled off代碼
有沒有辦法在代碼中設置locationServicesEnabled
?
我不相信你可以改變代碼,模擬器的設置,但可以很明顯的啓動/停止位置更新的自己的應用程序的檢查:
在代碼中啓動位置更新:
[CLLocationManager startUpdatingLocation]
停止位置更新代碼:
[CLLocationManager stopUpdatingLocation]
通過啓用
[CLLocationManager locationServicesEnabled]