MapView에서 현재 위치를 사용자에게 성공적으로 표시 할 수 있습니다. 그러나 다른보기 컨트롤러로 가서 내 mapview로 돌아와서 블루 스크린이 보입니다. 왜?MkMapView에 파란색 화면이 표시됩니다.
이 내 코드입니다 : 당신이 돌아 오는 시점에서
- (void)viewWillAppear:(BOOL)animated {
MyManager * myManager = [MyManager sharedInstance];
//if coming back from another screen, lets load the coordinates
if (myManager.centerOfMap) {
NSLog(@"myManager.centerOfMap has a value:");
self.centerOfMap = myManager.centerOfMap;
}
CLLocationCoordinate2D zoomLocation;
zoomLocation = *(self.centerOfMap);
MKCoordinateRegion viewRegion = MKCoordinateRegionMakeWithDistance(zoomLocation, 0.5*METERS_PER_MILE, 0.5*METERS_PER_MILE);
MKCoordinateRegion adjustedRegion = [_mapView regionThatFits:viewRegion];
[_mapView setRegion:adjustedRegion animated:YES];
}
이 블루 스크린은 실제로 바다입니다. Windows 블루 스크린과 혼동하지 말고 PC를 바다에 던지려합니다. – yinkou