1
我正在開發一個帶有註釋的iPhone應用程序,我已經完成了插入所有註釋的工作。我已經用了所有的註釋(X100)的代碼是:MapKit中最接近的註釋列表
CLLocationCoordinate2D theCoordinate1;
theCoordinate1.latitude = 59.92855;
theCoordinate1.longitude = 10.80467;
MyAnnotation* myAnnotation1=[[MyAnnotation alloc] init];
myAnnotation1.coordinate=theCoordinate1;
[email protected]"Økern Senter - DNB";
[email protected]"Økernveien 145, 0580 OSLO";
[mapView addAnnotation:myAnnotation1];
[annotations addObject:myAnnotation1];
我不知道什麼是我怎樣才能在顯示最接近的註釋給用戶位置的列表中的所有這些位置?
謝謝!接受用戶位置的最佳方式是什麼,就像你在第二個代碼中寫的那樣? –
使用[核心位置框架](http://developer.apple.com/library/ios/#documentation/CoreLocation/Reference/CoreLocation_Framework/_index.html)。我爲它添加了委託方法。不過,我建議您選擇計算代碼,因爲委託方法可以經常返回。也許你不想重新計算用戶移動的每一釐米。 –
@GThamanTitan問題解決了嗎? –