我正在尝试管理这个库,并希望制作转发消息。
该方法特别是:
- (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 pathath
queryParameters:nil body:nil
requestType:MGTwitterUpdateSendRequest
responseType:MGTwitterStatus];
}
此方法未在库本身中实现,我已添加。
我不知道updateId是什么。我尝试使用来自json的id,但我不知道什么是正确的id ..:
见字典:{
contributors = "";
coordinates = "";
"created_at" = "Wed Aug 24 07:41:50 +0000 2011";
favorited = false;
geo = "";
id = **106269972766011392**;
"in_reply_to_screen_name" = "";
"in_reply_to_status_id" = "";
"in_reply_to_user_id" = "";
place = "";
"possibly_sensitive" = false;
"retweet_count" = 0;
retweeted = false;
source = "<a href=\"http://www.tweetdeck.com\" rel=\"nofollow\">TweetDeck</a>";
"source_api_request_type" = 1;
text = "Buenos d\U00edas familia! Vuelve Tom Waits... http://t.co/3fbLqbb #musica";
truncated = 0;
user = {
"contributors_enabled" = false;
"created_at" = "Tue Jan 13 14:25:32 +0000 2009";
"default_profile" = false;
"default_profile_image" = false;
description = "Twitter Oficial de Vodafone Espa\U00f1a para compartir noticias y novedades ";
"favourites_count" = 4;
"follow_request_sent" = false;
"followers_count" = 26260;
following = 1;
"friends_count" = 11928;
"geo_enabled" = false;
id = 18939115;
"is_translator" = false;
lang = en;
"listed_count" = 1429;
location = "from Madrid";
name = "vodafone_espa\U00f1a";
notifications = false;
"profile_background_color" = BADFCD;
"profile_background_image_url" = "http://a1.twimg.com/profile_background_images/303932010/twitter_ro3.jpg";
"profile_background_image_url_https" = "https://si0.twimg.com/profile_background_images/303932010/twitter_ro3.jpg";
"profile_background_tile" = false;
"profile_image_url" = "http://a1.twimg.com/profile_images/1299308789/Twitter-800x800pxNEW_normal.jpg";
"profile_image_url_https" = "https://si0.twimg.com/profile_images/1299308789/Twitter-800x800pxNEW_normal.jpg";
"profile_link_color" = FF0000;
"profile_sidebar_border_color" = F2E195;
"profile_sidebar_fill_color" = ebebeb;
"profile_text_color" = 0C3E53;
"profile_use_background_image" = true;
protected = 0;
"screen_name" = "vodafone_es";
"show_all_inline_media" = false;
"statuses_count" = 8109;
"time_zone" = Madrid;
url = "http://www.vodafone.es";
"utc_offset" = 3600;
verified = false;
};
}
看看是否有人使用过此功能,我可以伸出援助之手!
非常感谢你!
答案 0 :(得分:0)
尝试将以下代码中的%u更改为%@,并将更新ID作为NSString
传递
NSString *path = [NSString stringWithFormat:@"statuses/retweet/%u.%@", updateID, API_FORMAT];
在twitter中更新ID已经过了无符号的最大值: - )。
此外,您必须更新方法签名以传递字符串而不是unsigned int。