I am parsing some **JSON** being fetched from the twitter API. I have managed to find all keys i need apart from one which i suspect is because there can be multiple values for this key.

Here is the code i am using for everything else, and the structure of the JSON for the key i am trying to fetch, which is the media\_url in the media section.

Anyone got any pointers on how to access this value. I have tried `media.media_url` but that doesn't work, as should be expected i suppose give that it seems to be it's own dictionary.

Help greatly appreciated!

Thanks

Gareth

**EDIT 1**

I have also tried doing the following, but i get empty objects

```
        NSArray *media = dict[@"media"];
    NSDictionary *media0  = media[0];
    NSString *display_url = media0[@"display_url"];    

```

But do dice :

```
(
 {
    contributors = "<null>";
    coordinates = "<null>";
    "created_at" = "Tue Aug 20 08:33:59 +0000 2013";
    entities =         {
        hashtags =             (
                            {
                indices =                     (
                    0,
                    9
                );
                text = verygood;
            }
        );
        media =             (
                            {
                "display_url" = "pic.twitter.com/4Pw6QaotCf";
                "expanded_url" = "http://twitter.com/gazzer82/status/369739076271742977/photo/1";
                id = 369739076032667648;
                "id_str" = 369739076032667648;
                indices =                     (
                    10,
                    32
                );
                "media_url" = "http://pbs.twimg.com/media/BSGTuw6CIAAf3Us.jpg";
                "media_url_https" = "https://pbs.twimg.com/media/BSGTuw6CIAAf3Us.jpg";
                sizes =                     {
                    large =                         {
                        h = 768;
                        resize = fit;
                        w = 1024;
                    };
                    medium =                         {
                        h = 450;
                        resize = fit;
                        w = 600;
                    };
                    small =                         {
                        h = 255;
                        resize = fit;
                        w = 340;
                    };
                    thumb =                         {
                        h = 150;
                        resize = crop;
                        w = 150;
                    };
                };
                type = photo;
                url = "http://t.co/4Pw6QaotCf";
            }
        );
        symbols =             (
        );
        urls =             (
        );
        "user_mentions" =             (
        );
    };
    "favorite_count" = 0;
    favorited = 0;
    geo = "<null>";
    id = 369739076271742977;
    "id_str" = 369739076271742977;
    "in_reply_to_screen_name" = "<null>";
    "in_reply_to_status_id" = "<null>";
    "in_reply_to_status_id_str" = "<null>";
    "in_reply_to_user_id" = "<null>";
    "in_reply_to_user_id_str" = "<null>";
    lang = en;
    place = "<null>";
    "possibly_sensitive" = 0;
    "retweet_count" = 0;
    retweeted = 0;
    source = "<a href=\"http://www.apple.com/\" rel=\"nofollow\">OS X</a>";
    text = "#verygood http://t.co/4Pw6QaotCf";
    truncated = 0;
    user =         {
        "contributors_enabled" = 0;
        "created_at" = "Mon Nov 17 12:20:17 +0000 2008";
        "default_profile" = 0;
        "default_profile_image" = 0;
        description = "Video and Projection project manager for @sss_uk living in Cardiff. Hater of Cheese, lover of Red Wine.";
        entities =             {
            description =                 {
                urls =                     (
                );
            };
        };
        "favourites_count" = 12;
        "follow_request_sent" = 0;
        "followers_count" = 67;
        following = 0;
        "friends_count" = 225;
        "geo_enabled" = 1;
        id = 17440336;
        "id_str" = 17440336;
        "is_translator" = 0;
        lang = en;
        "listed_count" = 0;
        location = "51.477028,-3.18741";
        name = gazzer82;
        notifications = 0;
        "profile_background_color" = 352726;
        "profile_background_image_url" = "http://a0.twimg.com/images/themes/theme5/bg.gif";
        "profile_background_image_url_https" = "https://si0.twimg.com/images/themes/theme5/bg.gif";
        "profile_background_tile" = 0;
        "profile_image_url" = "http://a0.twimg.com/profile_images/1900659547/gareth-hussain_normal.jpg";
        "profile_image_url_https" = "https://si0.twimg.com/profile_images/1900659547/gareth-hussain_normal.jpg";
        "profile_link_color" = D02B55;
        "profile_sidebar_border_color" = 829D5E;
        "profile_sidebar_fill_color" = 99CC33;
        "profile_text_color" = 3E4415;
        "profile_use_background_image" = 1;
        protected = 0;
        "screen_name" = gazzer82;
        "statuses_count" = 897;
        "time_zone" = London;
        url = "<null>";
        "utc_offset" = 3600;
        verified = 0;
    };
}
)

    for (NSDictionary *dict in filteredTweets) {

    //Set the variables
    NSString *userTweet = [dict valueForKey:@"text"];
    NSString *userScreenName = [dict valueForKeyPath:@"user.screen_name"];
    NSString *userRealName = [dict valueForKeyPath:@"user.name"];
    NSString *tweetDate = [dict valueForKey:@"created_at"];
    NSString *avatarURL = [dict valueForKeyPath:@"user.profile_image_url"];
    NSString *tweetIDString = [dict valueForKeyPath:@"id_str"];
    NSString *imagePath = [dict valueForKeyPath:@"media..media_url"];
}

```