更改CLLocation的坐标 [英] Changing coordinates of CLLocation

查看:92
本文介绍了更改CLLocation的坐标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Objective C的新手,所以这可能是一个小问题:

I'm new to Objective C, so this might be a trivial issue:

初始化位置后:

CLLocation *currentPoint = [[CLLocation alloc] initWithLatitude:0 longitude:0]:

如何更改纬度和经度?

how can I change the latitude and longitude later?

推荐答案

CLLocation 对象是不可变的(您不能更改它们) 。根据文档:

CLLocation objects are immutable (you can't change them). According to the docs:


通常,您使用CLLocationManager对象基于用户设备的最后已知位置创建此类的实例。但是,如果您要缓存自定义位置数据或获取两个不同坐标点之间的距离,您可以自己创建实例。

Typically, you use a CLLocationManager object to create instances of this class based on the last known location of the user’s device. You can create instances yourself, however, if you want to cache custom location data or get the distance between two different coordinate points.

这篇关于更改CLLocation的坐标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆