gpt4 book ai didi

ios8 - 在 IOS-8 中通过 SLComposeViewController 在 facebook 和 twitter 上发布

转载 作者:行者123 更新时间:2023-12-01 03:37:35 29 4
gpt4 key购买 nike

我曾尝试使用 SLComposeViewController 在 facebook 和 twitter 上发帖。我的代码是

 -(void)postToFacebookWithObject:(id)object FromController:(UIViewController*)vc {

if ([SLComposeViewController isAvailableForServiceType:SLServiceTypeFacebook])
{
SLComposeViewController *controller = [SLComposeViewController composeViewControllerForServiceType:SLServiceTypeFacebook];
SLComposeViewControllerCompletionHandler myBlock = ^(SLComposeViewControllerResult result){
if (result == SLComposeViewControllerResultCancelled)
{
DLog(@"Cancelled");

}
else
{
DLog(@"Done");
}
[controller dismissViewControllerAnimated:YES completion:Nil];
};
controller.completionHandler =myBlock;
[controller removeAllImages];
[controller removeAllURLs];
NSMutableDictionary *item = (NSMutableDictionary *)object;
[controller setInitialText:[item objectForKey:@"DealTitle"]];
if([item objectForKey:@"DealImage"])
[controller addImage:[item objectForKey:@"DealImage"]];
if([item objectForKey:@"url"])
[controller addURL:[NSURL URLWithString:[item objectForKey:@"url"]]];

[vc presentViewController:controller animated:YES completion:Nil];
}
else
{
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"" message:LocStr(@"NO_FACEBOOK_ACCOUNT_CONFIGURED") delegate:nil cancelButtonTitle:@"Ok" otherButtonTitles:nil];
[alert show];
DLog(@"UnAvailable");
}

}

this working fine in ios 7 but in ios 8 this sheet coming behind my view which i have added on window. How i can fix this?enter image description here

最佳答案

我通过在 navigationcontroller.view 上而不是在窗口上添加我的 View 来解决这个问题。

关于ios8 - 在 IOS-8 中通过 SLComposeViewController 在 facebook 和 twitter 上发布,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26115549/

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