在iOS 5.1中从应用程序打开Twitter设置

时间:2012-03-28 19:53:38

标签: iphone twitter settings

我正在我的iPhone应用程序中实现Twitter,如果用户没有设置任何Twitter帐户,我希望他能够从我的应用程序打开他的Twitter设置。在iOS 5.1中有没有办法做到这一点?

在iOS 5.0中,我们可以执行以下操作,但我还没有找到在5.1中执行此操作的方法

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"prefs:root=TWITTER"]];

2 个答案:

答案 0 :(得分:3)

试试这个..

 TWTweetComposeViewController *ctrl = [[TWTweetComposeViewController alloc] init];
        if ([ctrl respondsToSelector:@selector(alertView:clickedButtonAtIndex:)]) {
            // Manually invoke the alert view button handler
            [(id <UIAlertViewDelegate>)ctrl alertView:nil
                                 clickedButtonAtIndex:0];
        }
        [ctrl release];

答案 1 :(得分:1)

我不知道原因,但Apple已删除设置应用程序URL方案。是的,它在iOS 5.0中工作,但它在5.1

中不起作用