0
我寫這個代碼來獲得追隨者的ID列表:iOS版Twitter的API沒有返回的追隨者
+ (void)getTwitterFriendsIDListForAccount:(ACAccount *)account withHandler:(TWFriendsListHandler)handler
{
NSMutableString *paramString = [[NSMutableString alloc] init];
NSURL *url = [NSURL URLWithString:@"http://api.twitter.com/1.1/followers/ids.json"];
NSDictionary *params = @{@"screen_name" : account.username};
SLRequest *twRequest = [SLRequest requestForServiceType:SLServiceTypeTwitter
requestMethod:SLRequestMethodGET
URL:url
parameters:params];
[twRequest setAccount:account];
[twRequest performRequestWithHandler:^(NSData *responseData, NSHTTPURLResponse *urlResponse, NSError *error) {
if (error) {
handler(nil, error);
}
NSError *jsonError = nil;
NSDictionary *twitterFriends = [NSJSONSerialization JSONObjectWithData:responseData
options:NSJSONWritingPrettyPrinted
error:&jsonError];
NSArray *IDlist = [twitterFriends objectForKey:@"ids"];
int count = IDlist.count;
for (int i = 0; i < count; i++) {
[paramString appendFormat:@"%@", [IDlist objectAtIndex:i]];
if (i < count - 1) {
NSString *delimeter = @",";
[paramString appendString:delimeter];
}
}
[self getFollowerNameFromID:paramString forAccount:account withHandler:handler];
}];
}
帳戶參數從ACAccountStore拍攝和IS NOT NULL,但我發現了一個空響應 - responseData包含0個字節。這個過去幾個星期前工作,所以我沒有看到問題可能是什麼。有什麼建議麼?