Twitter 私信 - iPhone

问题描述 投票:0回答:1

我一直在尝试检索直接消息并将它们放入时间线中。我已经成功地做到了这一点,但这不是我想要的方式...我有点困惑,似乎找不到问题的答案。

我收到了尽可能多的直接消息,但在将它们放入全部显示的表格视图中时遇到问题。

如果您对 Twitter 了解一二,直接消息是向您发送消息的用户列表,然后您单击其中一个,它会向您显示实际消息。

所以我尝试只使用

user_id
因为在项目列表中日志返回的是显示用户 ID 并且仍然做同样的事情。
user_id
screen_name
profile_image_url
都是主词典“发送者”“接收者”的子类别,但是当我将它们放在表视图中时,我就崩溃了......

下面是我如何解析对象以及它们的工作方式,但我似乎无法做到它应该真正做的事情

任何帮助将非常感激!

//_______________________________________________________________
//  DirecctMessages Parse
//_______________________________________________________________

-(NSString*)sender {

return [contents objectForKey:@"sender"]   ; 



}




-(NSString*)sender_id {

return [[contents objectForKey:@"sender"] objectForKey:@"sender_id"]  ; 



}


-(NSString*)sender_screenName {

return [[contents objectForKey:@"sender"] objectForKey:@"screen_name"]  ; 



}

-(NSString*)sender_profileImage {

return [[contents objectForKey:@"sender"] objectForKey:@"profile_image_url"]  ; 



}

这是日志

"created_at" = "Fri Jun 17 03:11:25 +0000 2011";
id = 3279750226;
recipient =     {
    "contributors_enabled" = false;
    "created_at" = "Wed Nov 10 10:58:54 +0000 2010";
    "default_profile" = false;
    "default_profile_image" = false;
    description = "Creator of xQuisite HD, Omega HD, AfterHours-HD, BlueBird-HD, ..a web  
and IOS5 http://www.youtube.com/user/FreeAppl3";
    "favourites_count" = 1;
    "follow_request_sent" = false;
    "followers_count" = 935;
    following = 1;
    "friends_count" = 256;
    "geo_enabled" = true;
    id = 214019964;
    "is_translator" = false;
    lang = en;
    "listed_count" = 23;
    location = "From NY 518 in Houston 281";
    name = "Anthony Cornell";
    notifications = false;
    "profile_background_color" = 131516;
    "profile_background_image_url" = 
"http://a2.twimg.com/profile_background_images/256254613/top-wrapper-bg.jpg";
    "profile_background_tile" = true;
    "profile_image_url" = 
"http://a2.twimg.com/profile_images/1361674958/Wintboard_200px_normal.png";
    "profile_link_color" = 0485db;
    "profile_sidebar_border_color" = eeeeee;
    "profile_sidebar_fill_color" = efefef;
    "profile_text_color" = 0896f5;
    "profile_use_background_image" = true;
    protected = 0;
    "screen_name" = FreeAppl3;
    "show_all_inline_media" = false;
    "statuses_count" = 6166;
    "time_zone" = "";
    url = "http://idevicethemes.com";
    "utc_offset" = "";
    verified = false;
};
"recipient_id" = 214019964;
"recipient_screen_name" = FreeAppl3;
sender =     {
    "contributors_enabled" = false;
    "created_at" = "Tue Jul 27 15:12:30 +0000 2010";
    "default_profile" = false;
    "default_profile_image" = false;
    description = "Currently a private platform..The one place all Geeks meet. One place 
to call home. We are not building an army. WE are building a Legion. #bAdGB";
    "favourites_count" = 12;
    "follow_request_sent" = false;
    "followers_count" = 699;
    following = 0;
    "friends_count" = 126;
    "geo_enabled" = false;
    id = 171526185;
    "is_translator" = false;
    lang = en;
    "listed_count" = 30;
    location = "Houston/U.S.A";
    name = bAdGB;
    notifications = false;
    "profile_background_color" = C0DEED;
    "profile_background_image_url" =   
"http://a3.twimg.com/profile_background_images/154928929/geek.jpg";
    "profile_background_tile" = true;
    "profile_image_url" = 
"http://a2.twimg.com/profile_images/1320730007/ProfilePhoto_normal.png";
    "profile_link_color" = 0084B4;
    "profile_sidebar_border_color" = C0DEED;
    "profile_sidebar_fill_color" = DDEEF6;
    "profile_text_color" = 333333;
    "profile_use_background_image" = false;
    protected = 0;
    "screen_name" = bAdGigabit;
    "show_all_inline_media" = false;
    "statuses_count" = 3088;
    "time_zone" = "Central Time (US & Canada)";
    url = "http://www.bAdGB.com";
    "utc_offset" = "-21600";
    verified = false;
};
"sender_id" = 171526185;
"sender_screen_name" = bAdGigabit;
"source_api_request_type" = 13;
text = "Dude. U should add a function to let the user get push updates on a themer   he  
subscribes too ";
}
ios twitter message
1个回答
0
投票

是因为sender对象内部没有

sender_id
吗?相反,请尝试使用
id

© www.soinside.com 2019 - 2024. All rights reserved.