iOS学习之CoreLocation相关知识

IOS8 使用CoreLocation获取地理位置请求不弹出的解决方法:

1.在Info.list文件下添加一个键为NSLocationWhenInUseUsageDescription,值为想要给用户看到的文本(也可以为空)

2.定义一个CLLocationManager后,使用[_locationManager requestWhenInUseAuthorization];请求用户允许获取地理位置

 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卫星定位: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. 

编写获取地理位置时应处理以下几种情况:

• 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 

原文地址:https://www.cnblogs.com/guitarandcode/p/5487648.html