IOS7 - SLComposeViewController - 发布到Twitter时出错 - 无法发送推文 - 连接失败

时间:2013-11-14 15:55:56

标签: ios twitter slcomposeviewcontroller

我正在尝试使用IOS7 SLComposeViewController实现Twitter帖子,我收到以下错误 -

  

由于与Twitter的连接失败,无法发送推文“blah blah”。

我在推文中包含图片和网址 - 如果这有任何区别......

以下代码 -

SLComposeViewController *composeController = [SLComposeViewController composeViewControllerForServiceType:SLServiceTypeTwitter];

[composeController setInitialText:@"i ran with 18 chickens under my armpits for 18 hours"];
[composeController addImage:[UIImage imageNamed:@"zoeLrg.png"]];
[composeController addURL: [NSURL URLWithString:
                            @"http://www.nme.com"]];

[self presentViewController:composeController
                   animated:YES completion:nil];

SLComposeViewControllerCompletionHandler myBlock = ^(SLComposeViewControllerResult result){
    if (result == SLComposeViewControllerResultCancelled) {

        NSLog(@"delete");

    } else

    {
        NSLog(@"post");
    }

    [composeController dismissViewControllerAnimated:YES completion:Nil];
};
composeController.completionHandler =myBlock;

1 个答案:

答案 0 :(得分:4)

您可以检查调试控制台以查看返回的错误吗?通常,这些消息将提供更多信息。此外,如果您的设备上配置了多个帐户,则会出现与之相关的开放雷达问题,这可能适用于您的情况。请检查http://www.openradar.me/radar?id=5262535380959232