我正在开发一个基于 Twitter 的应用程序,我想在其中获取已登录 Twitter 用户的朋友列表。我为此做了一个代码,但它返回错误。
NSMutableArray *arr = [[NSMutableArray alloc] init];
NSMutableDictionary *accountDictionary = [NSMutableDictionary dictionaryWithObjectsAndKeys:account.username, @"screen_name", nil];
[accountDictionary setObject:[[[account dictionaryWithValuesForKeys:[NSArray arrayWithObject:@"properties"]] objectForKey:@"properties"] objectForKey:@"user_id"] forKey:@"user_id"];
NSURL *followingURL = [NSURL URLWithString:[NSString stringWithFormat:@"https://api.twitter.com/1.1/friends/list.json?cursor=-1&screen_name=%@&skip_status=true&include_user_entities=false",account.username]];
NSDictionary *parameters = [NSDictionary dictionaryWithObjectsAndKeys:account.username, @"screen_name", nil];
TWRequest *twitterRequest = [[TWRequest alloc] initWithURL:followingURL
parameters:parameters
requestMethod:TWRequestMethodGET];
[twitterRequest setAccount:account];
NSError *jsonError = nil;
NSData *responseData;
NSDictionary *twitterFriends = [NSJSONSerialization JSONObjectWithData:responseData options:NSJSONWritingPrettyPrinted error:&jsonError];
[accountDictionary setObject:[twitterFriends objectForKey:@"list"] forKey:@"friends_list"];
return arr;
我收到此错误:
{ errors = ( { code = 34; message = "抱歉,该页面不存在"; } ); }