Ios6 完成:当前ModalViewController上无

Ios6 完成:当前ModalViewController上无,ios6,deprecated,Ios6,Deprecated,当我设定 [self presentModalViewController:Facebookcontroller animated:YES]; 到 要删除presentModalViewController:animated已弃用:在iOS 6.0中首次弃用 另一个警告: 实例方法“-presentModalViewController:animated:completion:“找不到返回类型默认值”“id” 您确定self在此上下文中是UIViewController吗。您只能从另一个UIV

当我设定

[self presentModalViewController:Facebookcontroller animated:YES];

要删除presentModalViewController:animated已弃用:在iOS 6.0中首次弃用

另一个警告:

实例方法“-presentModalViewController:animated:completion:“找不到返回类型默认值”“id”

您确定self在此上下文中是UIViewController吗。您只能从另一个UIViewController调用此代码

确保首先初始化Facebookcontroller类,不能仅传递该类。Facebookcontroller*Facebookcontroller=Facebookcontroller alloc]init]

对于iOS 6使用:

[self presentViewController:Facebookcontroller animated:YES completion:^{
    //Do whatever you want to do when the controller 'Facebookcontroller' is presented.
}];


您可以找到参考资料。

Yes;。不管怎么说,它对我有用!那被解雇的控制器呢。。。相同?看起来不错,您可能希望使用facebookController而不是facebookController。签出:是将其用于DismissViewControllerInitiated:完成:
[self presentViewController:Facebookcontroller animated:YES completion:^{
    //Do whatever you want to do when the controller 'Facebookcontroller' is presented.
}];
[self presentViewController:Facebookcontroller animated:YES completion:nil];