关于Core Location,我有一个快速的问题,我正在尝试计算两个点之间的距离,如下所示的代码:
-(void)locationChange:(CLLocation *)newLocation:(CLLocation *)oldLocation
{
// Configure the new event with information from the location.
CLLocationCoordinate2D newCoordinate = [newLocation coordinate];
CLLocationCoordinate2D oldCoordinate = [oldLocation coordinate];
CLLocationDistance kilometers = [newCoordinate distanceFromLocation:oldCoordinate] / 1000; // Error ocurring here.
CLLocationDistance meters = [newCoordinate distanceFromLocation:oldCoordinate]; // Error ocurring here.
}
我在最后两行遇到以下错误:
错误:无法转换为指针类型
我已经在谷歌上搜索了,但是找不到任何相关信息。