Varying content with CLPlacemark, administrativeArea, iOS6/iOS7

▼魔方 西西 提交于 2019-12-12 15:16:39

问题


I'm planning to make an app for ios7, and have an issue with the administrativeArea Placemark Attribute.

For iOS6 i get the full name of the administrative area (ex. "California"), but for the iOS7, I get the value of "CA". This is a problem when its so varying. Is there any way I can control this input so its more consistent?

The apple docs doesnt eigher explain this in details.. http://developer.apple.com/library/mac/documentation/CoreLocation/Reference/CLPlacemark_class/Reference/Reference.html#//apple_ref/occ/instp/CLPlacemark/administrativeArea

Thanks!


回答1:


You can only parse it to uoy needed value. I can offer you find the list of administrative areas with full name and with little. After you can add this in 2 .txt files, import them in project,create 2 NSArrays and initialize each array in cycle. After you can check administrative area name and return right value.



来源:https://stackoverflow.com/questions/18300419/varying-content-with-clplacemark-administrativearea-ios6-ios7

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!