我的 DetailViewController 的笔尖上有一个 MapView,但是每当我在将其推送到导航控制器堆栈之前尝试在不同的视图控制器中访问该属性时,我都会发现该属性仍然为零,所以什么也没有发生。有谁知道为什么会发生这种情况?UIImageViews 也发生在我身上,这不仅仅是地图视图。(Xcode 5,ios7)
DetailViewController *dvc = [[DetailViewController alloc] initWithNibName:@"DetailViewController" bundle:nil];
CLLocationCoordinate2D zoomLocation = [[AppDelegate sharedLocationManager] location].coordinate;
MKCoordinateRegion viewRegion = MKCoordinateRegionMakeWithDistance(zoomLocation, 0.5*METERS_PER_MILE, 0.5*METERS_PER_MILE);
[dvc.mapView setRegion:viewRegion animated:YES];
MomentAnnotation *myAnnotation = [[MomentAnnotation alloc] init];
myAnnotation.coordinate = zoomLocation;
myAnnotation.title = @"Photo";
[dvc.mapView addAnnotation:myAnnotation];
[self.navigationController pushViewController:dvc animated:YES];