我正在尝试从 twitter 获取朋友列表。
我正在尝试这段代码:但是我收到一个带有 5 个键的 NSDictionary:下一个光标、上一个光标、下一个光标 str、上一个光标 str 和用户:关键用户有 20 个对象的值..但都是空的......
怎么了?
-(void) obterInformacoesTwitter {
NSURL *url = [NSURL URLWithString:@"https://api.twitter.com/1.1/friends/list.json"];
NSMutableDictionary *parameters = [[NSMutableDictionary alloc] init];
[parameters setObject:_contaSelecionada.username forKey:@"screen_name"];
NSLog(@"Screen name %@", _contaSelecionada.username);
TWRequest *request = [[TWRequest alloc] initWithURL:url parameters:parameters requestMethod:TWRequestMethodGET];
request.account = _contaSelecionada;
[request performRequestWithHandler:^(NSData *responseData, NSHTTPURLResponse *urlResponse, NSError *error)
{
if (responseData) {
NSError *error = nil;
NSDictionary* dict = [NSJSONSerialization JSONObjectWithData:responseData options:NSJSONReadingMutableLeaves error:&error];
NSArray *dictArray = [dict valueForKey:@"users"];
if([dict objectForKey:@"error"]!=nil)
{
}
else
{
}
}
}];
[parameters release];
[request release];
}