My iPad application has a SplitViewController, a MasterViewController and a DetailViewController. From the DetailViewController, I need to create a temporary view (managed with a PaletteViewController: UIViewController, and designed in a xib file) that the user can move on the screen to be able to see what content is backwards.
in DetailViewController.m:
@synthesize paletteViewController=_paletteViewController;
(...)
- (IBAction) loadPalette: (id) sender{
if (_paletteViewController == nil) {
self.paletteViewController = [[PaletteViewController alloc] init];
}
self.paletteViewController.delegate=self;
[self.paletteViewController setModalPresentationStyle:UIModalPresentationFormSheet];
[self presentModalViewController:self.paletteViewController animated:YES];
(...)
I get an error message: Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Application tried to present modally an active controller .
Any idea?