AFNetworking を使用して UITableView に 50 以上の YouTube ビデオをロードする必要があります。
データをダウンロードするには、viewdidload で AFJSONRequestOperation を複数回使用する必要がありますか?
これが私が試したことです:
NSString *urlAsString = @"http://gdata.youtube.com/feeds/api/playlists/PL7CF5B0AC3B1EB1D5?v=2&alt=jsonc&max-results=50";
NSString *urlAsString2 = @"http://gdata.youtube.com/feeds/api/playlists/PL7CF5B0AC3B1EB1D5?v=2&alt=jsonc&max-results=50&start-index=51";
NSURL *url = [NSURL URLWithString:urlAsString];
NSURL *url2 = [NSURL URLWithString:urlAsString2];
NSURLRequest *request = [NSURLRequest requestWithURL:url];
NSURLRequest *request2 = [NSURLRequest requestWithURL:url2];
//今、私は何をすべきかわかりません。
AFJSONRequestOperation *operation = [AFJSONRequestOperation JSONRequestOperationWithRequest:request success:^(NSURLRequest *request, NSHTTPURLResponse *response, id JSON) {
self.videoMetaData = [JSON valueForKeyPath:@"data.items.video"];
self.allThumbnails = [JSON valueForKeyPath:@"data.items.video.thumbnail"];
[self.tableView reloadData];
// NSLog(@" video Meta Data %@", self.videoMetaData);
} failure:^(NSURLRequest *request, NSHTTPURLResponse *response, NSError *error, id JSON) {
NSLog(@"Request Failed with Error: %@, %@", error, error.userInfo);
}];
[operation start];