我可以通过提供纬度和经度来初始化一个 CLLocation
对象,如下所示:
CLLocation *location = [[CLLocation alloc] initWithLatitude:-43.242534 longitude:-54.93662];
如何使用精度值初始化一个CLLocation
对象,而不仅仅是经纬度?
我可以通过提供纬度和经度来初始化一个 CLLocation
对象,如下所示:
CLLocation *location = [[CLLocation alloc] initWithLatitude:-43.242534 longitude:-54.93662];
如何使用精度值初始化一个CLLocation
对象,而不仅仅是经纬度?
double desired_horizontal_accuracy = 200.0 // in meters
double desired_vertical_accuracy = 200.0 // in meters
[[CLLocation alloc] initWithCoordinate:CLLocationCoordinate2DMake(-43.242534,-54.93662)
altitude:-1
horizontalAccuracy:desired_horizontal_accuracy
verticalAccuracy:desired_vertical_accuracy
timestamp:[NSDate date]]
altitude
和timestamp
,我使用了与苹果文档中-initWithLatitude:longitude:
所说的默认值相同的值。请注意,保留了HTML标签。