dismissModalViewControllerAnimated not working on parentViewController
self.parentViewController
not working is in fact new to iOS 5. It has been ‘replaced’ with self.presentingViewController
.
This causes an interesting problem for code trying to be pre-iOS 5 compatible. Since as you have found
self.parentViewController
returns nil on iOS 5. And UIViewControllers
do not respond topresentingViewController
pre-iOS 5.
It leaves us doing something like this:
if ([self respondsToSelector:@selector(presentingViewController)])
{
[self.presentingViewController dismissModalViewControllerAnimated:YES];
}
else
[self.presentingViewController dismissModalViewControllerAnimated:YES];
}
else
{
[self.parentViewController dismissModalViewControllerAnimated:YES];
}
[self.parentViewController dismissModalViewControllerAnimated:YES];
}
dismissModalViewControllerAnimated not working on parentViewController
Reviewed by Unknown
on
12:24
Rating:
No hay comentarios: