【发布时间】:2012-07-24 00:19:24
【问题描述】:
在我的应用程序中,我想显示所有 Twitter 帐户列表,并允许用户选择其中一个来发送推文。如何从选定的帐户发送推文?可能吗?这是我的代码。我发送数据,但它总是使用第一个帐户...
ACAccountStore *accountStore = [[ACAccountStore alloc] init];
ACAccountType *accountType = [accountStore accountTypeWithAccountTypeIdentifier:ACAccountTypeIdentifierTwitter];
ACAccount *twitterAccount = [[accountStore accountsWithAccountType:accountType] objectAtIndex:0];
NSString *userName = [twitterAccount username];
NSLog(@"%@", userName);
TWTweetComposeViewController *twitter =
[[TWTweetComposeViewController alloc] init];
[twitter setInitialText:@"Hello"];
[twitter addURL:[NSURL URLWithString:_baseUrl]];
[tableViewController presentViewController:twitter animated:YES completion:nil];
【问题讨论】:
-
我必须为此 +1 以表示出色,但不小心使用了“twit”
-
ontopic:@Radislav,到目前为止你尝试了什么?纯粹的代码编写请求在 Stack Overflow 上是题外话——但我们很乐意帮助您自己编写!告诉我们what you've tried,以及您遇到的问题。
标签: objective-c ios cocoa-touch twitter