【发布时间】:2016-07-09 16:12:50
【问题描述】:
我正在尝试为 IndexPath.row 中的每一行打印位置,因为 IndexPath.row 确定他们希望在 TableView 中接收哪些特定内容。
来自 Firebase 的 NSDictionary 看起来像:x,y,x,y,x,y 等坐标。
0,1 = 第一个坐标 2,3 = 第二个坐标
Output: [55.617804300000003, 12.98939, 55.601572900000001, 12.979585399999999, 34.506667999999998, -81.948334000000003, -7.0909109999999993, 107.668887]
所以第一个0和1是x,y是第一个坐标,如下:
print(CLLocationCoordinate2D(latitude: openLocations[indexPath.row], longitude: openLocations[indexPath.row + 1]))
我们目前的结果如何:
x= longitude, y = altitude
x, y
0, 1
1, 2
2, 3
3, 4
5, 6
应该如何:
x= longitude, y = altitude
x, y
0, 1
2, 3
4, 5
6, 7
8, 9
NSDictionary 看起来像:
x,y,x,y,x,y ..
这应该是一件容易的事,但我现在的想法在其他地方,如果有任何人可以帮助我解决这个问题,我们将不胜感激。
提前致谢,
此致,
菲利普
【问题讨论】:
-
你的字典看起来根本不像字典,更像是一个数组