MGTwitterEngine添加了获取朋友/ ids的方法

时间:2011-10-25 04:29:31

标签: iphone ios twitter mgtwitterengine

我在向MGTwitterEngine添加了一些问题。我正在尝试添加对friends / ids的调用以返回ID后面的所有用户。我有一个新的方法,如下所示,但没有返回任何内容。我有正确的requestType或responseType吗?

- (NSString *)getFriendsIds:(NSString *)twitterID
{
NSString *path = [NSString stringWithFormat:@"friends/ids.%@", API_FORMAT];

NSMutableDictionary *params = [NSMutableDictionary dictionaryWithCapacity:0];
[params setObject:twitterID forKey:@"user_id"];

return [self _sendRequestWithMethod:nil path:path queryParameters:params body:nil 
                        requestType:MGTwitterUserInformationRequest
                       responseType:MGTwitterUsers];
}

解决:

我最终在我的模型中创建了自己的方法,因为我无法获得mgtwitter。它使用ASIHttp。

- (void) getTwitterFollowIDs:(NSString *) twitter_id
{
    [self setResponse: [NSString stringWithFormat:@""]];

    NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"https://api.twitter.com/1/friends/ids.json?user_id=%@", twitter_id]];
    ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL: url];

    // temporary during dev
    [request setValidatesSecureCertificate:NO];

    [request setDelegate:self];
    [request setDidFinishSelector:@selector(getTwitterFollowIDsDidFinish:)];
    [request setDidFailSelector:@selector(getTwitterFollowIDsDidFail:)];

    [request startAsynchronous];
}

0 个答案:

没有答案