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

我正在尝试使用IOS7 SLComposeViewController实现Twitterpost,我收到以下错误 –

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

我在推文中包含图片和url – 如果这有什么不同的话……

代码如下 –

 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; 

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