0

我正在使用 MGTwitterEngine 从 NSString 中获取配置文件,但我只得到列表中的第一个响应。将 MGTwitterEngine.m 中的方法更改为使用 screen_name 而不是 user_id 会给我一个 404 错误,使用 user_id 有效,但它只返回列表中的第一个。

NSString *path = [NSString stringWithFormat:@"users/lookup.%@?screen_name=%@", API_FORMAT, userIDs];

MGTwitterEngine.m

- (NSString *)getBulkUserInformationFor:(NSString *)userIDs{

if (!userIDs) {
    return nil;
    }

NSString *path = [NSString stringWithFormat:@"users/lookup.%@?user_id=%@", API_FORMAT, userIDs];
NSMutableDictionary *params = [NSMutableDictionary dictionaryWithCapacity:0];

return [self _sendRequestWithMethod:nil path:path queryParameters:params body:nil requestType:MGTwitterBulkUserInformationRequest responseType:MGTwitterUsers];}
enter code here

我的方法:

- (void)userInfoReceived:(NSArray *)userInfo forRequest:(NSString *)connectionIdentifier {

    for(NSDictionary *d in userInfo) {
    NSLog(@"dee: %@", d);}

..和我的电话:

[_engine getBulkUserInformationFor:@"14483463,25552002,1540791,307428962,61605222"];
4

1 回答 1

1

听起来与 mgtwitterengine 的 github 页面上的这个问题类似:

https://github.com/mattgemmell/MGTwitterEngine/issues/58

改变

#define TWITTER_DOMAIN @"twitter.com"

#define TWITTER_DOMAIN @"api.twitter.com/1" 

在 MGTwitterEngine.m

于 2011-07-21T21:23:35.440 回答