iOS 弃用函数

来源:互联网 发布:电力猫网络不稳定 编辑:程序博客网 时间:2024/04/29 00:54

概念:deprecated 弃用。表示已不被建议使用,可能随时取消它;建议采用新的来替代。

"modalViewController属性 is deprecated : first deprecated in iOS 6.0

而采用

presentedViewController

 

"dismissModalViewControllerAnimated" is deprecated : first deprecated in iOS 6.0

而采用

dismissViewControllerAnimated:(BOOL) completion:^(void)completion

如:[self dismissViewControllerAnimated:YES completion:nil];

 

"presentModalViewController: animated:" is deprecated : first deprecated in iOS 6.0

而采用

presentViewController:(UIViewController *) animated:(BOOL) completion:^(void)completion

如:[self.viewController presentViewController:controller animated:YES completion:nil];

 

"automaticallyForwardAppearanceAndRotationMethodsToChildViewControllersis deprecated : first deprecated in iOS 6.0

而采用

shouldAutomaticallyForwardRotationMethods 和 shouldAutomaticallyForwardAppearanceMethods

 

"shouldAutorotateToInterfaceOrientation:is deprecated : first deprecated in iOS 6.0

而采用

重载 supportedInterfaceOrientations 和 preferredInterfaceOrientationForPresentation 方法

 

 "viewDidUnload"和"viewWillUnload" 在iOS 6.0从不调用。 

0 0