在IOS-5中获取Twitter帐户列表并使用TWTweetComposeViewController对其进行使用 [英] Getting twitter account list in IOS-5 and user it with TWTweetComposeViewController

查看:163
本文介绍了在IOS-5中获取Twitter帐户列表并使用TWTweetComposeViewController对其进行使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Twitter与IOS-5集成。我使用苹果提供的推特应用程序。我正在使用TWTweetComposeViewController。

i am using Twitter with IOS - 5 integration. i used tweeting app provide by apple for this.I am using TWTweetComposeViewController for this.

但如果我有超过2个推特帐户。它每次都是我的第一个帐户。但我希望我的不同帐户的列表显示给我,然后当我选择一个帐户然后我可以使用它与TWTweetComposeViewController。我喜欢显示像贝娄图像来自:用户名

But if i have more than 2 twitter accounts. it is getting my first account every time. but i want that list of my different account shown to me and then when i select one of account and then i can use it with TWTweetComposeViewController. i like to show like bellow image From :"username"

我使用了这段代码:

 - (IBAction)sendEasyTweet:(id)sender {
// Set up the built-in twitter composition view controller.
TWTweetComposeViewController *tweetViewController = [[TWTweetComposeViewController alloc] init];

// Set the initial tweet text. See the framework for additional properties that can be set.
[tweetViewController setInitialText:@"Hello. This is a tweet."];
[tweetViewController addImage:[UIImage imageNamed:@"Icon.png"]];


// Create the completion handler block.
[tweetViewController setCompletionHandler:^(TWTweetComposeViewControllerResult result) {
    NSString *output;

    switch (result) {
        case TWTweetComposeViewControllerResultCancelled:
            // The cancel button was tapped.
            output = @"Tweet cancelled.";
            break;
        case TWTweetComposeViewControllerResultDone:
            // The tweet was sent.
            output = @"Tweet done.";
            break;
        default:
            break;
    }

    [self performSelectorOnMainThread:@selector(displayText:) withObject:output waitUntilDone:NO];

    // Dismiss the tweet composition view controller.
    [self dismissModalViewControllerAnimated:YES];
}];

// Present the tweet composition view controller modally.
[self presentModalViewController:tweetViewController animated:YES];

}

推荐答案

现在,我正在接受它,并且选择器正在显示它,如图所示

Now , i am getting my it , and picker is showing for it as shown in image

所以从这个选择器,我可以选择我的一个帐户作为推文。

so from this picker , i can select one of my account for tweet.

这篇关于在IOS-5中获取Twitter帐户列表并使用TWTweetComposeViewController对其进行使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆