我有一個MKMapView,它的委託設置爲我的控制器(m)類。下面MKMapView不顯示當前位置,或者更確切地說,任何位置(在模擬器中)
代碼:
-(BOOL)application:(UIApplication *)application
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// Create location manager object
locationManager = [[CLLocationManager alloc] init];
// Make this instance of WhereamiAppDelegate the delegate
// it will send its messages to our WhereamiApplDelegate
[locationManager setDelegate:self];
// We want all results from the location manager
[locationManager setDistanceFilter:kCLDistanceFilterNone];
[locationManager setDesiredAccuracy:kCLLocationAccuracyBest];
[mapView setShowsUserLocation:YES];
[window makeKeyAndVisible];
return YES;
}
然而,所有我看到的是世界地圖沒有標註的藍色圓點一個?