0
我有以下型号:我怎样才能分开这个核心数据?
在每个按钮上单击新值将得到保存,如:
for member in self.markersArray {
var newCoordinate = NSEntityDescription.insertNewObject(forEntityName: "Coordinates", into: managedObjectContext)
newCoordinate.setValue(member.latitude, forKey: "latitude")
newCoordinate.setValue(member.longitude, forKey: "longitude")
}
var newCoordinate = NSEntityDescription.insertNewObject(forEntityName: "Coordinates", into: managedObjectContext)
newCoordinate.setValue(mapName, forKey: "mapName")
我怎能他们这样分开,我可以指每个数据块通过mapName?
谢谢。为什么我需要省略选项1中的最终坐标? – konyv12
再次,您将拥有(例如)5个纬度/长度但没有名称的坐标和一个名称但没有纬度/长度的坐标。他们之间没有任何关系。在选项1中,每个坐标将具有lat/long **和**名称,因此不相关的单个坐标已过时。 – vadian