我对 MapKit 有一个奇怪的问题。我有一个带有注释的地图视图,当用户单击图钉时,我推送图钉的详细视图控制器
-(void)mapView:(MKMapView *)mapView didSelectAnnotationView:(MKAnnotationView *)view
{
if ([view.annotation isKindOfClass:[ImagePin class]])
{
if (!self.pinPhotoDetailViewController) {
self.pinPhotoDetailViewController = [[PinPhotoDetailViewController alloc] initWithNibName:@"PinPhotoDetailViewController" bundle:nil];
}
self.pinPhotoDetailViewController.managedObjectContext = self.managedObjectContext;
self.pinPhotoDetailViewController.photoID = view.annotation.title;
[self.navigationController pushViewController:self.pinPhotoDetailViewController animated:YES];
}
}
问题是当我弹回地图时,它改变了区域,现在显示用户当前位置的区域。我使用以下代码初始化地图视图:
- (void)viewDidLoad
{
[super viewDidLoad];
locationManager = [[CLLocationManager alloc] init];
[locationManager setDelegate:self];
[locationManager setDesiredAccuracy:kCLLocationAccuracyBest];
self.mapView.userTrackingMode = MKUserTrackingModeNone;
[self.mapView setShowsUserLocation:YES];
[locationManager setDistanceFilter:80.0f];
[locationManager setDesiredAccuracy:kCLLocationAccuracyBest];
firstLaunch=YES;
[self customizeStyle];
}
我在哪里做错了什么?