7
要獲得最後一個已知的地理位置,我有:CLLocationManager最後已知位置
CLLocationManager * locationManager = [[CLLocationManager alloc] init];
CLLocation * lastKnownLocation = [locationManager location];
是否lastKnownLocation反映最後位置我的應用程序已經與召回或者它反映了全球的iOS系統級的最後一個單元(哪些其他應用程序或iOS可能會查詢)?
我這樣做,而不是主動查詢用戶的位置,所以我不浪費用戶的電池。
如果用戶沒有授予訪問位置權限,顯然lastKnownLocation應該爲零。我的問題特別針對用戶已授予我的應用訪問位置權限的情況。
如何找出用戶在哪個城市?我只需要精確到100公里的位置數據。假設用戶至少在一個不同的應用中啓用了位置管理器至少一次,那意味着我在這裏得到了足夠的結果,對吧? 我真的很想念android的getLastKnownLocation()。 [鏈接](http://developer.android.com/reference/android/location/LocationManager.html#getLastKnownLocation(java.lang.String中))。 – stephanlindauer