gpt4 book ai didi

ios - 在dismissViewControllerAnimated 之后的presentViewController

转载 作者:行者123 更新时间:2023-12-01 17:56:23 24 4
gpt4 key购买 nike

我试图在关闭 View Controller 后呈现 View Controller ( SLServiceTypeFacebook )。像这样

[self.presentingViewController dismissViewControllerAnimated:YES completion:nil];

////////////////////////////////////
//Some Stuff Other Calculations//
////////////////////////////////////
//Then

if([SLComposeViewController isAvailableForServiceType: SLServiceTypeFacebook])
{
// Facebook Service Type is Available

SLComposeViewController *slVC = [SLComposeViewController composeViewControllerForServiceType: SLServiceTypeFacebook];
SLComposeViewControllerCompletionHandler handler = ^(SLComposeViewControllerResult result)
{
if (result == SLComposeViewControllerResultCancelled)
{
NSLog(@"Cancelled");

}
else
{
NSLog(@"Done");
}

[slVC dismissViewControllerAnimated:NO completion:Nil];
};
slVC.completionHandler = handler;
[slVC setInitialText:post[@"user_fullname"]];
[slVC addURL:[NSURL URLWithString:post[@"url"]]];

[self presentViewController:slVC animated:NO completion:Nil];
}

但这似乎不起作用。 Facebook 模态会自动取消。

我在概念上做错了吗?

最佳答案

像这样使用完成 block :

[self dismissViewControllerAnimated:NO completion:^{

//SHOW YOUR NEW VIEW CONTROLLER HERE!
}];

您缺少上面的完成处理程序。

关于ios - 在dismissViewControllerAnimated 之后的presentViewController,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16768920/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com