UIViewControllerHierarchyInconsistency beim Versuch, einen modalen Ansichtscontroller zu präsentieren

Versuch, einen modalen Ansichtscontroller mit dem folgenden Code zu präsentieren

MapViewController *mapView = [[MapViewController alloc] initWithNibName:@"MapViewController" bundle:nil];
    mapView.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
    [self.navigationController presentModalViewController:mapView animated:YES];
    [mapView release];

Erhalten Sie den folgenden Fehler weiterhin.

'UIViewControllerHierarchyInconsistency', reason: 'A view can only be associated with at most one view controller at a time! View <UIView: 0x1ed815a0; frame = (0 20; 320 460); autoresize = W+H; layer = <CALayer: 0x1ed81600>> is associated with <UIViewController: 0x1ed835a0>. Clear this association before associating this view with <MapViewController: 0x1dd947c0>.'

Dies ist ein altes Projekt, das ich seit Monaten nicht mehr angerührt habe.

Antworten auf die Frage(5)

Ihre Antwort auf die Frage