ログインした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;
次のエラーが表示されます。
{ エラー = ( { コード = 34; メッセージ = "申し訳ありませんが、そのページは存在しません"; } ); }