简体   繁体   中英

Anotherway for getting the latitude and longitude

我正在做一个应用程序,因为我想在单独的线程中查找当前位置的纬度和经度值,但是在单独的线程中不会触发CLLocationManager委托方法,所以请告诉我还有其他方法可以获取该信息

You are asking the wrong question.
You don't need that!

Just use the standard way of Cllocatiomanager delegate (didUpdatFromLocation...). This is all you need, that works in background, too. Getting that info is fast, that will in now way affect the performance of the main thread.

If you would have time consuming calulcations after you have got the lat/lon location, then you can send the coordinates to another thread which performs that calculations. But this then is in your responsibility, and does not interfere with apples framework.

And: there is no other way to get the current lat/lon, only didUpdateFromLocation...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM