iOS学习之CoreLocation相关知识
IOS8 使用CoreLocation獲取地理位置請(qǐng)求不彈出的解決方法:
1.在Info.list文件下添加一個(gè)鍵為NSLocationWhenInUseUsageDescription,值為想要給用戶看到的文本(也可以為空)
2.定義一個(gè)CLLocationManager后,使用[_locationManager requestWhenInUseAuthorization];請(qǐng)求用戶允許獲取地理位置
?
?CoreLocation獲取地理位置的三種方式:
1:蜂窩基站:Cell tower triangulation will always work if there is a signal but it’s not very precise.?
2:Wi-Fi:Wi-Fi positioning works better but that is only available if there are known Wi-Fi routers nearby. This system uses a big database that contains the locations of wireless networking equipment.?
3:GPS衛(wèi)星定位:You get the best results from the GPS (Global Positioning System) but that attempts a satellite communication and is therefore the slowest of the three. It also won’t work very well indoors.?
?
編寫獲取地理位置時(shí)應(yīng)處理以下幾種情況:
? Finds a location with the desired accuracy?
? Finds a location that is not as accurate as you’d like and you don’t get any more?accurate readings
? Doesn’t find a location at all
? Takes too long finding a location?
轉(zhuǎn)載于:https://www.cnblogs.com/guitarandcode/p/5487648.html
總結(jié)
以上是生活随笔為你收集整理的iOS学习之CoreLocation相关知识的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: poj1769 线段树优化的dp
- 下一篇: angularJs中ngModel的坑