如何在iPhone Twitter应用程序(MGTwitterEngine)上进行RETWEET

时间:2010-03-27 09:22:28

标签: iphone xcode twitter mgtwitterengine

如何在iPhone Twitter应用程序(MGTwitterEngine)上进行RETWEET

2 个答案:

答案 0 :(得分:5)

似乎在mattgemmell / MGTwitterEngine中尚未支持此功能。

与此同时,您可以通过引用此MGTwitterEngine变体将该函数添加到当前版本的MGTwitterEngine:  freeatnet / MGTwitterEngine

- (NSString *)sendRetweet:(unsigned long)updateID
{
  if (updateID == 0){
    return nil;
  }
  NSString *path = [NSString stringWithFormat:@"statuses/retweet/%u.%@", updateID, API_FORMAT];

  return [self _sendRequestWithMethod:HTTP_POST_METHOD path:path 

                        queryParameters:nil body:nil 
                            requestType:MGTwitterUpdateSendRequest
                           responseType:MGTwitterStatus];
}

答案 1 :(得分:1)

- (NSString *)sendRetweet:(unsigned long)updateID

{
    if (updateID == 0){

        return nil;
    }

    NSString *path = [NSString stringWithFormat:@"statuses/retweet/%u.%@", updateID, API_FORMAT];

    NSMutableDictionary *params = [NSMutableDictionary dictionaryWithCapacity:0];
        [params setObject:[NSString stringWithFormat:@"%@", updateID] forKey:@"id"];
        NSString *body = [self _queryStringWithBase:nil parameters:params prefixed:NO];


    return [self _sendRequestWithMethod:HTTP_POST_METHOD path:path 
                        queryParameters:params body:body 
                            requestType:MGTwitterUpdateSendRequest
                           responseType:MGTwitterStatus];
}