【发布时间】: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