我正在一个应用程序中在 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];