【问题标题】:Tweet from a specfic account in iOS 6?来自 iOS 6 中特定帐户的推文?
【发布时间】:2012-10-08 19:28:44
【问题描述】:

我正在一个应用程序中在 iOS6 上设置 twitter。 我偶然发现的问题是:用户有多个 Twitter 帐户我如何选择要分享到哪个帐户?

我已经设法将所有帐户放在一个数组中。 但问题是如何关联此帐户:

 ACAccount *acct = [_accounts objectAtIndex:twitterAccountInt];

有了这个:

slComposerSheetController = [SLComposeViewController composeViewControllerForServiceType:SLServiceTypeTwitter];
NSString *postText = [informationToBeShared objectForKey:@"postText"];
NSURL *postImageURL = [NSURL URLWithString:[informationToBeShared objectForKey:@"postImageURL"]];
NSURL *postURL = [NSURL URLWithString:[informationToBeShared objectForKey:@"postURL"]];

[slComposerSheetController setInitialText:[informationToBeShared objectForKey:@"postText"]];
[slComposerSheetController addImage:[UIImage imageWithData:[NSData dataWithContentsOfURL:postImageURL]]];
[slComposerSheetController addURL:postURL];
[delegate presentViewController:slComposerSheetController animated:YES completion:nil];

【问题讨论】:

    标签: iphone objective-c twitter ios6 social-framework


    【解决方案1】:

    如果用户在设置中添加更多 Twitter 帐户,操作系统会在 SLComposeViewController 上添加一个选项,用户可以在其中选择他想从哪个帐户发推文。

    不需要我做任何改变。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-01-01
      • 2012-05-03
      • 1970-01-01
      • 2021-09-20
      • 2020-10-05
      • 1970-01-01
      • 2018-10-14
      相关资源
      最近更新 更多