开发者

Twitter Direct Messages - iPhone

I have been trying to retrieve the direct messages and place them into a timeline. I have been successful at doing so, but it is not the way I intended... I am a bit confused and can not seem to find an answer to the issue.

I receive as many direct messages as I want but I have an issue while placing them in a tableview they all show.

If you know a thing or two about twitter the direct messages is a list of users who sent you messages then you click into one and is shows you the actual messages.

So I have tried using just the "user_id" because in a list of items the log returns is shows the user id and that still does the same thing. The user_id , scrren_name, profile_image_url are all sub catagories of the main dictionary "sender" reci开发者_开发百科pient" but when I place those in the table view I just crash.....

Below is how I parse the objets and they work but I caint seem to do what it is supposed to really do

Any help would be very much obliged!

//_______________________________________________________________
//  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"]  ; 



}

This is the log

"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 ";
}


Is it because there is no sender_id inside the sender object? Instead try using the id.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜