0
저는 AFNetworking을 사용하여 UITableView에서 JSON 데이터를 구문 분석합니다. YouTube API는 JSON 데이터에 최대 50 개의 동영상을 제공합니다. 나는 100 개 이상의 비디오를로드해야하고 어떻게해야할지 모르겠다. 여기UITableView에 50 개 이상의 YouTube 동영상을로드하는 방법은 무엇입니까?
http://gdata.youtube.com/feeds/api/playlists/PL7CF5B0AC3B1EB1D5?v=2&alt=jsonc&max-results=50
그리고 내 코드입니다 :
- (void)viewDidLoad
{
[super viewDidLoad];
NSString *urlAsString = @"http://gdata.youtube.com/feeds/api/playlists/PL7CF5B0AC3B1EB1D5?v=2&alt=jsonc&max-results=50";
NSURL *url = [NSURL URLWithString:urlAsString];
NSURLRequest *request = [NSURLRequest requestWithURL:url];
// This will initiate the request and parse the data using apples JSONSerialization
AFJSONRequestOperation *operation = [AFJSONRequestOperation JSONRequestOperationWithRequest:request success:^(NSURLRequest *request, NSHTTPURLResponse *response, id JSON) {
self.videoMetaData = [JSON valueForKeyPath:@"data.items.video"];
// This will have all the sq and hq thumbnails
self.allThumbnails = [JSON valueForKeyPath:@"data.items.video.thumbnail"];
오케이 그래서 여러 URL을 사용해야합니다. 한 페이지에 모든 결과를 보려면 어떻게합니까? – user1951876
예를 들어 결과를 'NSMutableArray'에 넣을 수 있습니다. – Emil
AFJSONRequestOperation을 여러 번 사용하고 결과를 새 배열에 추가해야합니까? – user1951876