5.0先後,對應的調用方法變了參數,並且若是用了5.0之後的方法在低版本上沒法使用,而用低版本對用的方法,apple已經不提倡,如今有一種解決辦法 api
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; app
在調用時判斷一下 spa
同理,dismiss時也是相似操做 it