Ios8 使用IOS-8在facebook和twitter上通过SLComposeViewController发布

Ios8 使用IOS-8在facebook和twitter上通过SLComposeViewController发布,ios8,xcode6,slcomposeviewcontroller,ios8-share-extension,Ios8,Xcode6,Slcomposeviewcontroller,Ios8 Share Extension,我曾尝试使用SLComposeViewController在facebook和twitter上发布帖子。我的代码是 -(void)postToFacebookWithObject:(id)object FromController:(UIViewController*)vc { if ([SLComposeViewController isAvailableForServiceType:SLServiceTypeFacebook]) { SLComposeViewCon

我曾尝试使用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");
}
}

这在ios 7中运行良好,但在ios 8中,这张表位于我在窗口中添加的视图后面。我怎样才能解决这个问题


我已通过在navigationcontroller上添加视图来解决此问题。视图不在窗口上

UINavigationController *forShare = [[UINavigationController alloc] initWithRootViewController:vc];
[forShare setNavigationBarHidden:YES];
[self presentViewController:forShare animated:NO completion:nil];
如果已设置动画:是,它不起作用
如果设置动画:不,对我有效

请升级iOS8的facebook sdk。使用Apple Social.framework时不需要facebook sdk,那么你认为升级sdk将如何解决问题?@Kylebegman我仍然面临这个问题。有没有办法解决这个问题?这是一个答案还是一个你有同样问题的问题?
I have resolved through open present-view controller in navigation-bar.it may help you.

SLComposeViewController *controller = [SLComposeViewController   composeViewControllerForServiceType:SLServiceTypeFacebook];
        [controller setInitialText:shareFrom];
        [controller addImage:self.photoImageView.image];
        [controller addURL:[NSURL URLWithString:dayCareWebsite]];
        dispatch_async(dispatch_get_main_queue(), ^ {

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

        });