Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/xcode/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios MKUserLocation坐标现在在Xcode 6.3中是只读的_Ios_Xcode_Swift_Mapkit_Mkuserlocation - Fatal编程技术网

Ios MKUserLocation坐标现在在Xcode 6.3中是只读的

Ios MKUserLocation坐标现在在Xcode 6.3中是只读的,ios,xcode,swift,mapkit,mkuserlocation,Ios,Xcode,Swift,Mapkit,Mkuserlocation,我的应用程序中有MKUserLocation的脉动点。 现在,随着新的Xcode 6.3的出现,MapKit发生了变化,因此下面的代码不再工作 var anno = MKUserLocation() anno.coordinate = locationNew 同时,将从MapKit中删除setCoordinate()方法 有人知道如何在MapView中将脉动点移动到自定义位置吗?MKUserLocation类中没有坐标属性。为什么要设置用户位置?用户的位置无法由您自己更新。请参阅。但是,仍然无

我的应用程序中有
MKUserLocation
的脉动点。 现在,随着新的
Xcode 6.3
的出现,
MapKit
发生了变化,因此下面的代码不再工作

var anno = MKUserLocation()
anno.coordinate = locationNew
同时,将从
MapKit
中删除
setCoordinate()
方法


有人知道如何在MapView中将脉动点移动到自定义位置吗?

MKUserLocation类中没有坐标属性。为什么要设置用户位置?用户的位置无法由您自己更新。请参阅。但是,仍然无法在MKUserLocation上设置坐标,因为它是默认的只读,就像MKAnnotation协议所说的那样。其他类(如MKPointAnnotation)以读写方式重写坐标。@YogeshSuthar:MKUserLocation确实具有坐标属性(根据定义,注释必须具有坐标属性)。这在doc链接中并不明显,但请注意,它符合
MKAnnotation
协议,其中坐标是必需的属性。在早期版本中,可以实例化MKUserLocation并操纵坐标以在自定义位置的地图视图上生成脉动点。还有其他解决办法吗?