Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Per <a href="https://dev.twitter.com/docs/tweet-entities" rel="nofollow">Twitter's documentation on entities</a>, <code>entities</code> is a dictionary and <code>urls</code> is an array of dictionaries.</p> <p>When you perform <code>... valueForKeyPath:@"entities.urls.display_url"]</code> you do the same thing as <code>... valueForKey:@"entities"] valueForKey:@"urls] valueForKey:@"display_url"]</code>.</p> <p>Per <a href="https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Classes/NSDictionary_Class/Reference/Reference.html#//apple_ref/occ/instm/NSDictionary/valueForKey%3a" rel="nofollow"><code>NSDictionary</code>'s documentation</a>, its <code>valueForKey:</code> returns the same thing as <code>objectForKey:</code> if — as in this case — the key in question doesn't start with an @.</p> <p>So the <code>entities</code> part of <code>valueForKeyPath:</code> returns an array of objects.</p> <p>Per <a href="https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Classes/NSArray_Class/NSArray.html#//apple_ref/occ/instm/NSArray/valueForKey%3a" rel="nofollow"><code>NSArray</code>'s documentation</a>, its <code>valueForKey:</code> returns an array comprised of the result of calling <code>valueForKey:</code> on each object in the array individually.</p> <p>Given that each thing in the <code>entities</code> array is a dictionary, what you therefore get back is an array of the <code>display_url</code> key for every entity in the tweet.</p> <p>So I think your problem is that you expect to get "<em>the</em> actual URL from the tweet" (emphasis added). Tweets may contain arbitrary many links outward, not merely one — entities represent ranges of characters with special meanings like links, hashtags and similar. So you end up with an array rather than a single value.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload