问题
I've used the following method from MGTwitterEngine.m
in order to fetch the friend list:
(NSString *)getFriendsIds:(NSString *)twitterID
{
NSString *path = [NSString stringWithFormat:@"friends/ids.%@", API_FORMAT];
NSMutableDictionary *params = [NSMutableDictionary dictionaryWithCapacity:0];
[params setObject:twitterID forKey:@"user_id"];
return [self _sendRequestWithMethod:nil path:path queryParameters:params body:nil
requestType:MGTwitterUserInformationRequest
responseType:MGTwitterUsers];
}
And in my class I've made the following call:
NSLog(@"friends %@",[_engine getFriendsIds:@"user_id"]);
I couldn't retreive the friend list.
回答1:
- (void)userInfoReceived:(NSArray *)userInfo forRequest:(NSString *)connectionIdentifier {
//NSLog(@"User Info Received: %@", userInfo);
followTweet = [[TweetFollow alloc]initWithStyle:UITableViewStylePlain];//Table
TweetModel *tweetFollw = [[TweetModel alloc]initWithTweetFollwerArray:userInfo];//Model
[followTweet.tweetFollow addObject:tweetFollw];
NSLog(@"ARRYYYYYY: %@",followTweet.tweetFollow );
followTweet.view.frame = CGRectMake(161, 0, 160, 420);
[self.view addSubview:followTweet.view];
[tweetFollw release];
}
#define TWITTER_DOMAIN @"api.twitter.com/1" // Plz change this in to MGTwitterEngin.m
-(void)viewWillApper {
//_engine is instance of MGTwitterEngin class
[_engine getFollowersIncludingCurrentStatus:NO];
}
This is simple code by which you can get the twitter Friend list ; Thank you !!
来源:https://stackoverflow.com/questions/9194514/fetch-twitter-friend-list-after-authentification