I want to parse this JSON YouTube recently featured. This is how I get the title of the videos:
NSString *response = [request responseString];
responseDict = [response JSONValue];
videoTitleArray = [responseDict valueForKeyPath:@"feed.entry.title.$t"];
And it works like I want it. But I also want to display the author of the video. But the following code for this does not work properly:
videoAuthorArray = [responseDict valueForKeyPath:@"feed.entry.author.name.$t"];
NSLog(@"%@", videoAuthorArray);
The list of the authors I get looks like this:
(
author 1
),
(
author 2
),
(
author 3
),
(
author 4
),
I can't display the names in for example a table view because of the brackets. How can I display the author names like the video titles?
When you see an Author you see this:
this means: author is an array of author objects
each author object has:
nameobject, auriobject and ayt$userIdobjecteach of this objects described above is a
NSDictionaryformated we have:
so if you have your
videoAuthorArrayeach element is anNSDictionaryand has this keys:name,uriandyt$userIdeach of this objects has an
NSDictionarywith a single key:$twitch has the value