Before and after 5.0, the corresponding call method has changed the parameter. If a method later than 5.0 is used and cannot be used in a lower version, apple does not advocate the method used in a lower version, there is a solution
[Cpp]
AboutViewController * mAboutViewController = [[AboutViewController alloc] initWithNibName: @ "AboutViewController" bundle: nil];
If ([self respondsToSelector: @ selector (presentViewController: animated: completion :)]) {
[Self. navigationController presentViewController: mAboutViewController animated: YES completion: nil];
} Else {
[Self. navigationController presentModalViewController: mAboutViewController animated: YES];
}
[MAboutViewController release];
MAboutViewController = nil;
Determine when calling
Similarly, dismiss is a similar operation.
[Cpp]
If ([self respondsToSelector: @ selector (dismissViewControllerAnimated: completion :)]) {
[Self dismissViewControllerAnimated: YES completion: nil];
} Else {
[Self dismissModalViewControllerAnimated: YES];
}
Similarly, in the future, when the apple High Version sdk does not support the api of the lower version, a similar judgment can be used to solve the compatibility problem of the high and low versions.
From andy Pan's column