こんにちは、iOS 6 で現在の Twitter ユーザーのフォロワー数を取得するにはどうすればよいですか?
2 に答える
0
このコードを使用
(IBAction)listFriends:(id)sender {
NSMutableArray *arr = [[NSMutableArray alloc]init];
dict=[[NSMutableDictionary alloc]init];
[_tweetField resignFirstResponder];
dispatch_async(GCDBackgroundThread, ^{
@autoreleasepool {
[UIApplication sharedApplication].networkActivityIndicatorVisible = YES;
//to get friends id.......
NSLog(@"Friends' IDs: %@",[[FHSTwitterEngine sharedEngine]getFriendsIDs]);
/* dict = [[FHSTwitterEngine sharedEngine]getFollowersIDs];
for (NSDictionary *item in [dict objectForKey:@"ids"]) {
[arr addObject:[dict objectForKey:@"ids"]];
}*/
// To get friends name ...
// NSLog(@"Friends_Name: %@",[[FHSTwitterEngine sharedEngine]listFriendsForUser:_loggedInUserLabel.text isID:NO withCursor:@"-1"]);
dict = [[FHSTwitterEngine sharedEngine]listFriendsForUser:_loggedInUserLabel.text isID:NO withCursor:@"-1"];
NSLog(@"====> %@",[dict objectForKey:@"users"] );
NSMutableArray *array=[dict objectForKey:@"users"];
for(int i=0;i<[array count];i++)
{
NSLog(@"names:%@",[[array objectAtIndex:i]objectForKey:@"name"]);
}
// NSLog(@"Friends_Name: %@",[[FHSTwitterEngine sharedEngine]getMentionsTimelineWithCount:1000 sinceID:nil maxID:nil]);
dispatch_sync(GCDMainThread, ^{
@autoreleasepool {
UIAlertView *av = [[UIAlertView alloc]initWithTitle:@"Complete!" message:@"Your list of followers has been fetched" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
[av show];
[UIApplication sharedApplication].networkActivityIndicatorVisible = NO;
// NSLog(@"====> %d",[arr count]);
}
});
}
});
}
于 2013-10-21T09:36:21.267 に答える