我在这里找到了一个类似的旧帖子: showsUserLocation does not display blue dot in iPhone 4.0
我有这个代码:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
locationManager=[[CLLocationManager alloc]init];
[locationManager setDelegate:self];
[locationManager setDistanceFilter:kCLDistanceFilterNone];
[locationManager setDesiredAccuracy:kCLLocationAccuracyBest];
//[locationManager startUpdatingLocation];
mapView.showsUserLocation=YES;
NSLog(@"bool: %d", [mapView showsUserLocation]);
// Override point for customization after application launch.
self.viewController = [[[WhereamiViewController alloc] initWithNibName:@"WhereamiViewController" bundle:nil] autorelease];
self.window.rootViewController = self.viewController;
[self.window makeKeyAndVisible];
return YES;
}
为什么NSLog(@"bool: %d", [mapView showsUserLocation])
显示0
,不显示1
?为什么我不能设置它YES
?