I had a perfectly working project until I upgraded to ios6.
when I find a tab in a panel element to show a popover with an application crash view ...
here is the error i get
"reason: 'A view can only be associated with at most one view controller at a time! View <UIView: 0xaa7d730; frame = (20 0; 748 1024); autoresize = RM+BM; layer = <CALayer: 0xaa7d790>> is associated with <TYOFormViewController: 0xaa7d8b0>. Clear this association before associating this view with <TYOFormViewController: 0x14c68a70>.'"
and here is a method that declares a UIViewController and a UIPopoverController.
- (IBAction)TestDriveTapped:(id)sender{ if (PopoverController != nil) { [PopoverController dismissPopoverAnimated:YES]; self.PopoverController = nil; } if (self.PopoverController == nil) { UIViewController *bookTestDrive =[[TYOFormViewController alloc] initWithNibName:@"TYOBookTestDriveForm" bundle:nil]; UIPopoverController *poc = [[UIPopoverController alloc] initWithContentViewController:bookTestDrive]; [poc presentPopoverFromBarButtonItem:sender permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES]; self.PopoverController = poc; } else { if (PopoverController != nil) { [PopoverController dismissPopoverAnimated:YES]; self.PopoverController = nil; } }
}
The error says that I need to clear the connection with TYOFormViewController in order to associate it with TYOFormViewController .... How did this happen ???
I would like to help you with this question ... jstuck all day with him ..
thanks
source share