如何以编程方式从iphone中的Twitter获取追随者列表?

时间:2014-01-21 10:49:42

标签: twitter sttwitter

这里我有一段代码

(void)postToTwitter:(id)sender 
{

    if ([SLComposeViewController isAvailableForServiceType:SLServiceTypeTwitter])
    {
        SLComposeViewController *tweetSheet = [SLComposeViewController composeViewControllerForServiceType:SLServiceTypeTwitter];
        [tweetSheet setInitialText:@"Great fun to learn iOS programming at softwareWeaver!"];
        [self presentViewController:tweetSheet animated:YES completion:nil];
    }

}

但接下来要做什么????

1 个答案:

答案 0 :(得分:2)

您可以使用STTwitter library,这使得所有这一切变得非常简单:

self.twitter = [STTwitterAPI twitterAPIOSWithFirstAccount];

[_twitter verifyCredentialsWithSuccessBlock:^(NSString *username) {

    [_twitter getFollowersForScreenName:username successBlock:^(NSArray *followers) {
        NSLog(@"-- %@", followers);
    } errorBlock:^(NSError *error) {
        //
    }];

} errorBlock:^(NSError *error) {
    //
}];