我正在开发与 iOS5 和 iOS6 兼容的 iOS 应用程序(仅限 iPhone 应用程序)
我使用 XCODE 4.5 (4G182) 开发
该应用程序需要在 Twitter 上发布推文
对于 ios6 实现,我成功使用了 UIActivityViewController 类
对于 ios5 实现,我正在使用 Twitter.framework 中的 TWTweetComposeViewController,我正在使用以下代码(已在我使用以前的 XCODE 版本开发的以前的应用程序中使用并工作)
TWTweetComposeViewController *tweetSheet = [[TWTweetComposeViewController alloc] init]; tweetSheet.completionHandler = ^(TWTweetComposeViewControllerResult result) { [self dismissModalViewControllerAnimated:YES]; }; NSString *textToShare = @"Tweet Example"; [tweetSheet setInitialText:textToShare]; [self presentModalViewController:tweetSheet animated:YES];
此代码显示标准 Twitter 面板,但在我按下发送按钮后,我收到带有以下消息的警报:
无法发送推文
推文“推文示例”无法发送,因为与 Twitter 的连接失败。
[取消] [再试一次]
我还尝试编译 Apple 示例应用程序“Tweetie”,并在 ios5 iPhone 上得到相同的结果,我在第一代 iPad (ios5.1) 上对其进行了测试,它似乎工作正常
有人有同样的问题吗?你有什么建议吗?
谢谢你