DismissViewController UIButton causes my app to crash when testing on iPod touch. Otherwise, it is working fine on iPhone. iPod version is 4.2.1.
The message I am getting is:
dismissViewControllerAnimated:completion:]: unrecognized selector sent to instance 0x153720′
-(void)dismissViewDidFinish:(UIViewController *)viewController
{
[self dismissViewControllerAnimated:YES completion:nil];
}
This is the modalviewcontroller h file:
@class Info;
@protocol InfoDelegate
-(void)dismissViewDidFinish:(UIViewController *)viewController;
@end
Where is the method “dismissViewController” defined? It’s not a framework method. If you’ve used code from an example, be sure you define the method where you intend to. It is not a method on UIViewController.
If you are trying to dismiss a modal view controller, from the modal view controller, the way to do it is: