0

MKPolylines の+ polylineWithCoordinates:count:メソッドを呼び出そうとしています。

この場合、CLLocationCoordinate2D * オブジェクトを作成するにはどうすればよいですか。CLLocationCoordinate2Dでこの特定の答え を調べましたが、配列にいくつあるかわかりませんか?

// 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 にはどのようなエントリがありますか?

4

2 に答える 2

0

あなたの質問が単に配列内のエントリの種類である場合、答えは非常に簡単です:NSValueエントリ. の使用方法の詳細については、このガイドNSValuesを参照してください。

于 2013-06-26T08:37:08.653 に答える