简体   繁体   English

将CLLocationCoordinate2D数组作为返回类型传递

[英]Passing CLLocationCoordinate2D Array as return type

Hi have a method which has to return CLLocationCoordinate2D array. 嗨,有一个方法必须返回CLLocationCoordinate2D数组。 Is there a way to do this? 有没有办法做到这一点?

CLLocationCoordinate2D coordinates[count]; CLLocationCoordinate2D坐标[count]; I wanna return coordinates; 我想返回坐标;

I don't want to put this on array and send as NSArray, Just want to send as CLLocationCoordinate2D array. 我不想将其放在数组上并作为NSArray发送,只想作为CLLocationCoordinate2D数组发送。

To Set - 设置 -

CLLocationCoordinate2D cooArray[5];
    cooArray[0] = _locationCoo1;
    cooArray[1] = _locationCoo2;
    cooArray[2] = _locationCoo3;
    cooArray[3] = _locationCoo4;

To Get - 要得到 -

CLLocationCoordinate2D location1 = cooArray[0];

To get Size of Array 获取数组大小

 NSLog(@" :%lu", sizeof(cooArray));

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM