Basically I have two xibs, the first one is the main xib that contains a button that triggers an IBAction that calls:
UIViewController *overlaywindow = [[UIViewController alloc] initWithNibName:@"NewInvenView" bundle:nil];
overlaywindow.modalPresentationStyle = UIModalPresentationFormSheet;
overlaywindow.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[self presentViewController:overlaywindow animated:YES completion:nil];
This produces the result I want.
However, in NewInvenView.xib I’m trying to create a button that will dismiss itself (and close the PresentingView). I link the button with the NewInvenViewController.h and implements the method in NewInvenViewController.m. But when I run it, it doesn’t work.
Whenever the button is triggered, the function is called but I get an error:
2012-12-24 20:33:50.984 Dokodemo[1467:907] * Terminating app due to
uncaught exception ‘NSInvalidArgumentException’, reason:
‘-[UIViewController filterstock:]: unrecognized selector sent to
instance 0x21033990’…
I think it’s also important to note that, I get an error regardless of what is inside the function implementation. Even when the function does nothing
why is this?
If you Do the flip Animation with navigationController it will be Easy.
// if you using latest Version of iOS Just Change the following
[self.navigationController presentViewController:nvc animated:YES completion:nil];in your Second view Controller You can use this to Dismiss.