【发布时间】:2013-06-26 08:28:00
【问题描述】:
我正在尝试调用 MKPolylines 的 + polylineWithCoordinates:count: 方法。
在这种情况下如何创建 CLLocationCoordinate2D * 对象。我在CLLocationCoordinate2D without knowing how many will be in the array?
中完成了这个特定的答案// unpacking an array of NSValues into memory
CLLocationCoordinate2D *points = malloc([mutablePoints count] * sizeof(CLLocationCoordinate2D));
for(int i = 0; i < [mutablePoints count]; i++) {
[[mutablePoints objectAtIndex:i] getValue:(points + i)];
}
MKPolyline *myPolyline = [MKPolyline polylineWithCoordinates:points count:[mutablePoints count]];
free(points);
在上述情况下,数组 mutablePoints 中有哪些条目?
【问题讨论】:
标签: iphone ios cllocationmanager