我也被卡住了,也很愚蠢,我正在尝试将一个或NSString
一个NSNumber
放入initWithLatitude
. CLLocation
如果有人可以提供帮助,那就太好了。
这是代码
CLLocation *location1 = [[CLLocation alloc] initWithLatitude:53.778702 longitude:-0.271887];
CLLocation *location2 = [[CLLocation alloc] initWithLatitude:53.683267 longitude:-0.011330];
label.text = [NSString stringWithFormat:@"Distance in miles: %4.1f", [location1 distanceFromLocation:location2]/1609.344];
[location1 release];
我正在尝试替换[[CLLocation alloc] initWithLatitude:53.778702 longitude:-0.271887]
为[[CLLocation alloc] initWithLatitude:lat longitude:lon]