正如我需要一張地圖我使用的代碼的當前位置:問題在iPhone SDK中得到一個地圖的當前位置
locationManager = [[CLLocationManager alloc] init];
locationManager.delegate = self;
locationManager.desiredAccuracy = kCLLocationAccuracyNearestTenMeters;
[locationManager setDistanceFilter:10];
[locationManager startUpdatingLocation];
我正在錯誤的didFailWithError methos爲:
- (void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *)error
{
printf("\nXXXXXXXXXXXXXXXXXXXXXXXXXX Inside didFailWithError in locationmanager method XXXXXXXXXXXXXXXXXXXXXXXXXX");
NSLog(@"Error: %@", error);
}
,我在我的控制檯收到錯誤信息如下:
XXXXXXXXXXXXXXXXXXXXXXXXXX Inside didFailWithError in locationmanager method XXXXXXXXXXXXXXXXXXXXXXXXXX2010-12-06 17:58:12.335 ParkingAreaLocator[6992:207] Error: Error Domain=kCLErrorDomain Code=0 "The operation couldn’t be completed. (kCLErrorDomain error 0.)"
和WiFi上。
我沒有在模擬器和設備4.0 sdk中獲取當前位置。
任何人都可以幫助我如何解決這個問題。
謝謝 Monish
你有沒有嘗試,爲什麼精度較差? – 2010-12-06 12:44:18