These days, when you do an iOS project, you need to navigate to get the name of the current city. Baidu Map SDK has this function, but in order to not rely on third parties, here use iOS comes with frame corelocation to achieve this requirement. After iOS8 out, for positioning needs a little more processing, can be normal positioning.
Aside from this: Many social, e-commerce, group buying applications have introduced maps and positioning functions, and map functionality is no longer unique to map applications and navigation applications. With maps and positioning, it really makes our lives more colorful and dramatically changes our way of life. For example, you go to a strange place to find nearby hotels, supermarkets and so on can open the software search surrounding; Similarly, there are a lot of group buying software can automatically recommend certain items to you based on your location ( of course, for businesses, these services are definitely not free, This is also the map-type software profit point is located ) [ system, Baidu, German ];
IOS 8 Targeting:
Allow GPS description for use in foreground
Nslocationalwaysusagedescription=yes
Description of allow permanent use of GPs
Nslocationwheninuseusagedescription=yes
next comes the related code
The following are the printing results:
In addition, the location of the service is best to run on the real machine, the location of the simulator a bit pit, need to make some relevant settings
IOS uses system targeting to get current latitude and longitude and geographic information