UIViewControllerHierarchyInconsistency
Estoy tratando de construir mi aplicación y en un momento presiono un UIViewController y luego recibo este error. No estoy exactamente seguro de por qué.
'UIViewControllerHierarchyInconsistency', motivo: '¡Una vista solo puede asociarse con un controlador de vista como máximo a la vez! Ver> está asociado con. Borre esta asociación antes de asociar esta vista con '.
PageViewController *viewController;
viewController = [[PageViewController alloc] initWithManagedObjectContext:managedObjectContext];
dataSource = [[PagesDataSource alloc] initWithManagedObjectContext:managedObjectContext];
PVPage *selectedPage = [[dataSource pages] objectAtIndex:itemIndex];
[viewController setRepresentedPage:selectedPage];
PageFlipperAppDelegate *appDelegate = (PageFlipperAppDelegate *)[[UIApplication sharedApplication] delegate];
[(UINavigationController *)[[appDelegate window] rootViewController] setToolbarHidden:YES animated:YES];
[(UINavigationController *)[[appDelegate window] rootViewController] pushViewController:viewController animated:YES];
En mi pageViewController ...................
- (id)initWithManagedObjectContext:(NSManagedObjectContext *)initManagedObjectContext
{
if ((self = [super initWithNibName:@"PageView" bundle:nil]))
{
[self setManagedObjectContext:initManagedObjectContext];
dataSource = [[PagesDataSource alloc] initWithManagedObjectContext:[self managedObjectContext]];
}
return self;
}