由于 ios5.0 中添加了 twitter 框架,我正在使用它的类TWTweetComposeViewController
if([TWTweetComposeViewController canSendTweet])
{
NSLog(@"can send tweet");
}
else{
NSString *message = @"The application cannot send a tweet at the moment. This is because it cannot reach Twitter or you don't have a Twitter account associated with this device.";
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Oops" message:message delegate:nil cancelButtonTitle:@"Dismiss" otherButtonTitles:nil];
[alertView show];
}
在此步骤中,我需要向用户显示 twitter 的登录页面。为此,我是否应该将用户重定向到设置以登录用户?
如果是,则此代码不起作用
NSURL *twitterURL = [NSURL URLWithString:@"prefs:root=TWITTER"];
[[UIApplication sharedApplication] openURL:twitterURL];
我也读过一些这在 ios6 中不起作用的地方。那么我应该怎么做才能让用户登录一会儿而不直接发送推文。现在我只想让用户登录。
我也参考了这个问题 它与 ios6 一起工作得很好,但在这种情况下,我该如何处理 ios5.1 ?
任何帮助将不胜感激....