MGTwitterEngine 添加获取好友/id 的方法
我在添加 MGTwitterEngine 时遇到一些问题。我正在尝试添加对朋友/ID 的调用,以返回遵循 ID 的所有用户。我有一个新方法,如下所示,但没有返回任何内容。我有正确的请求类型或响应类型吗?
- (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];
}
I am having some issues adding to MGTwitterEngine. I am trying to add a call to friends/ids to return all of a users following ID's. I have a new methods as shown below, but nothing is returned. Do I have the correct requestType or 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];
}
Solved:
I ended up creating my own method in my model because I couldn't get mgtwitter to do it. Its using 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];
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论