我嘗試顯示在地圖上的位置,這裏是代碼:問題與CLLocationManager在iPhone模擬器
locationManager = [[CLLocationManager alloc] init];
locationManager.distanceFilter = kCLDistanceFilterNone;
locationManager.desiredAccuracy = kCLLocationAccuracyBest;
[locationManager.location initWithLatitude:latitude longitude: longitude];
NSLog(@"%f", [selectedBuilding.latitude doubleValue]);
[locationManager startUpdatingLocation];
但是,不管是什麼座標我提供,藍點始終位於加州,這似乎在默認行爲,有什麼額外的我需要做的?謝謝。
你是模擬器嗎?此外,您不應將自己的位置設置爲LocationManager屬性,因爲它是隻讀的 – mja
是的,我處於模擬器中,並且已啓用IB中的「顯示用戶位置」。 – Michael
看看這裏http://stackoverflow.com/questions/802156/testing-corelocation-on-iphone-simulator – mja