使用FHSTwitterEngine检索关注者时出错

时间:2014-01-20 06:02:19

标签: ios objective-c ios7 fhs-twitter-engine

我在我的应用程序中集成了FHSTwitterEngine,用于从Twitter获取关注者。它之后工作正常5次会产生如下错误

Error Domain=Twitter successfully processed the request, but did not return any content Code=204 "The operation couldn’t be completed. (Twitter successfully processed the request, but did not return any content error 204.)"

我正在尝试这样

NSMutableArray *followersArray = [[NSMutableArray alloc]init];
NSMutableDictionary *dict = [[FHSTwitterEngine sharedEngine]listFollowersForUser:[[FHSTwitterEngine sharedEngine]loggedInUsername] isID:YES withCursor:@"-1"];
if ([dict isKindOfClass:[NSError class]]) {
     NSLog(@"Getting error and the error is %@",dict);
}else{
    if ([[dict allKeys]count]>0) {
        [followersArray addObjectsFromArray:[dict objectForKey:@"users"]];
        for (int m=1; m!=0; ) {
           dict = [[FHSTwitterEngine sharedEngine]listFollowersForUser:[[FHSTwitterEngine sharedEngine]loggedInUsername] isID:YES withCursor:[dict objectForKey:@"next_cursor_str"]];
           if ([dict isKindOfClass:[NSError class]]) {
               NSLog(@"Getting error and the error is %@",dict);
               break;
           }else{
               m = [[dict objectForKey:@"next_cursor"] intValue];
               [followersArray addObjectsFromArray:[dict objectForKey:@"users"]];
           }
        }
        NSLog(@"The followers list is %@",followersArray);
    }
}

请建议我如何解决此问题。提前谢谢。

1 个答案:

答案 0 :(得分:0)

试试这个:

[[FHSTwitterEngine sharedEngine]listFollowersForUser:[[FHSTwitterEngine sharedEngine]loggedInUsername] isID:NO withCursor:@"-1"];