<i id='upuG0'><tr id='upuG0'><dt id='upuG0'><q id='upuG0'><span id='upuG0'><b id='upuG0'><form id='upuG0'><ins id='upuG0'></ins><ul id='upuG0'></ul><sub id='upuG0'></sub></form><legend id='upuG0'></legend><bdo id='upuG0'><pre id='upuG0'><center id='upuG0'></center></pre></bdo></b><th id='upuG0'></th></span></q></dt></tr></i><div id='upuG0'><tfoot id='upuG0'></tfoot><dl id='upuG0'><fieldset id='upuG0'></fieldset></dl></div>

  • <legend id='upuG0'><style id='upuG0'><dir id='upuG0'><q id='upuG0'></q></dir></style></legend>
    <tfoot id='upuG0'></tfoot>

      1. <small id='upuG0'></small><noframes id='upuG0'>

          <bdo id='upuG0'></bdo><ul id='upuG0'></ul>

      2. 如何在 iOS 上的变量中获取位置(纬度和经度值)

        时间:2023-09-02

      3. <tfoot id='R3aBv'></tfoot>
        1. <legend id='R3aBv'><style id='R3aBv'><dir id='R3aBv'><q id='R3aBv'></q></dir></style></legend>
            <bdo id='R3aBv'></bdo><ul id='R3aBv'></ul>
              <i id='R3aBv'><tr id='R3aBv'><dt id='R3aBv'><q id='R3aBv'><span id='R3aBv'><b id='R3aBv'><form id='R3aBv'><ins id='R3aBv'></ins><ul id='R3aBv'></ul><sub id='R3aBv'></sub></form><legend id='R3aBv'></legend><bdo id='R3aBv'><pre id='R3aBv'><center id='R3aBv'></center></pre></bdo></b><th id='R3aBv'></th></span></q></dt></tr></i><div id='R3aBv'><tfoot id='R3aBv'></tfoot><dl id='R3aBv'><fieldset id='R3aBv'></fieldset></dl></div>

                <small id='R3aBv'></small><noframes id='R3aBv'>

                    <tbody id='R3aBv'></tbody>

                  本文介绍了如何在 iOS 上的变量中获取位置(纬度和经度值)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我想使用我的应用用户的位置,更具体地说是纬度和经度值.

                  I would like to use the location of my app user, more specifically the latitude and longitude value.

                  我需要它们在变量中使用,这样我就可以用 url 发送它们...

                  I need them to use in a variable, so that I can send them with an url...

                  我以前从未在 iOS 和 Xcode 上使用过位置,但在 Internet 上没有找到与我的问题相符的内容...

                  I never worked before withe locations on iOS and Xcode and found nothing matching for my problem on the Internet...

                  所以我希望有人可以用代码示例向我解释一下:)

                  So I hope someone can explain it to my with a code sample :)

                  谢谢你的帮助来自德国的劳伦兹

                  Thx for u help Laurenz from Germany

                  推荐答案

                  可以使用CoreLocation获取经纬度.

                  You can use CoreLocation to get the longitude and latitude.

                  包含框架:

                  在导航器中单击您的项目.

                  Click your project in navigator.

                  单击将二进制文件与库链接"下的加号按钮

                  Click the plus button under "link binary with libraries"

                  将 Corelocation 添加到您的项目中.

                  Add Corelocation to your project.

                  导入头文件:

                  #import <CoreLocation/CoreLocation.h>
                  

                  声明 CLLocationManager:

                  CLLocationManager *locationManager;
                  

                  初始化 locationManager:

                  - (void)viewDidLoad
                  {
                      locationManager = [[CLLocationManager alloc] init];
                      locationManager.distanceFilter = kCLDistanceFilterNone; 
                      locationManager.desiredAccuracy = kCLLocationAccuracyHundredMeters;
                      [locationManager startUpdatingLocation];
                  }
                  

                  然后,使用

                  float latitude = locationManager.location.coordinate.latitude;
                  float longitude = locationManager.location.coordinate.longitude;
                  

                  这篇关于如何在 iOS 上的变量中获取位置(纬度和经度值)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:如何在 Google Map Api V2 Android 中搜索? 下一篇:locationManager.getLastKnownLocation() 返回 null

                  相关文章

                  最新文章

                  <legend id='75Gfv'><style id='75Gfv'><dir id='75Gfv'><q id='75Gfv'></q></dir></style></legend>

                    <bdo id='75Gfv'></bdo><ul id='75Gfv'></ul>

                    <tfoot id='75Gfv'></tfoot>
                  1. <i id='75Gfv'><tr id='75Gfv'><dt id='75Gfv'><q id='75Gfv'><span id='75Gfv'><b id='75Gfv'><form id='75Gfv'><ins id='75Gfv'></ins><ul id='75Gfv'></ul><sub id='75Gfv'></sub></form><legend id='75Gfv'></legend><bdo id='75Gfv'><pre id='75Gfv'><center id='75Gfv'></center></pre></bdo></b><th id='75Gfv'></th></span></q></dt></tr></i><div id='75Gfv'><tfoot id='75Gfv'></tfoot><dl id='75Gfv'><fieldset id='75Gfv'></fieldset></dl></div>
                    1. <small id='75Gfv'></small><noframes id='75Gfv'>