I have this custom back button:
- (IBAction)backToMenu:(id)sender {
[self.presentingViewController dismissModalViewControllerAnimated:YES];
}
Testing my app in the iOS 6 simulator says dismissModalViewControllerAnimated is deprecated, and I must use dismissViewControllerAnimated instead, so, how I can use the iOS 6 code and fallback to iOS 5
I have tried this:
if([self respondsToSelector:@selector(presentingViewController:animated:completion:)])
[self.presentingViewController dismissViewControllerAnimated:(YES) completion:nil];
else if([self respondsToSelector:@selector(presentingViewController:animated:)])
[self.presentingViewController dismissModalViewControllerAnimated:YES];
else
NSLog(@"Oooops, what system is this ?!!! - should never see this !");
But without results, I'm seeing the NSLog and no view is dismissed, any hints?
Thank you in advance.