Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9285595
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T19:12:22+00:00 2026-06-18T19:12:22+00:00

I using AFNetworking to populate a UITableView with youtube videos. YouTube API only allows

  • 0

I using AFNetworking to populate a UITableView with youtube videos. YouTube API only allows maximum 50 result for each request. So I have to use multiple URLs to get more than 50 results.

I created a Method which will do AFNetworkings AFJSONRequestOperation on the given URLs.

I think the UITable is getting created before i receive the JSON data. Everything was working perfectly before i created the Method.

This the first time i have created a Method. I have been trying to load more than 50 youtube videos on a UITable for the last few days.Please have a look at my code.

Here is my code, you can also download the entire project from

QQViewController.m

-(void)viewWillAppear:(BOOL)animated {

    [super viewWillAppear:animated];
    //[super viewDidLoad];

    NSString *urlAsString = @"http://gdata.youtube.com/feeds/api/playlists/PL7CF5B0AC3B1EB1D5?v=2&alt=jsonc&max-results=50";


    // I am not sure how i am supposed to populate the uitableview with the second link :(

     NSString *urlAsString2 = @"http://gdata.youtube.com/feeds/api/playlists/PL7CF5B0AC3B1EB1D5?v=2&alt=jsonc&max-results=50&start-index=51";



    self.myurl = [NSURL URLWithString:urlAsString];

    [self getJSONfromURL:self.myurl];

[self.tableView reloadData];

}

-(void)viewDidAppear:(BOOL)animated {

        [super viewDidAppear:animated]; 

        self.videoMetaData = [self.myJSON valueForKeyPath:@"items.video"];

        NSLog(@" QQVC video Meta Data %@", self.videoMetaData);


        self.allThumbnails = [self.myJSON valueForKeyPath:@"data.items.video.thumbnail"];


        // The table need to be reloaded or else we will get an empty table.

        [self.tableView reloadData]; // Must Reload

        // NSLog(@" video Meta Data %@", self.videoMetaData);


}

// Here is the Method

-(void)getJSONfromURL:(NSURL *)url {

    NSURLRequest *request = [NSURLRequest requestWithURL:url];
    // setup AFNetworking stuff
    AFJSONRequestOperation *operation = [AFJSONRequestOperation JSONRequestOperationWithRequest:request success:^(NSURLRequest *request, NSHTTPURLResponse *response, id JSON) {
        // call delegate or processing method on success

       // [self.myJSON = (NSArray *)JSON];

        self.myJSON = [JSON valueForKey:@"data"];
        [self.tableView reloadData];
       //NSLog(@" in get JSon method %@", self.myJSON);

    } failure:^(NSURLRequest *request, NSHTTPURLResponse *response, NSError *error, id JSON) {
        NSLog(@"Request Failed with Error: %@, %@", error, error.userInfo);
    }];


    [operation start];



}

- (void)viewDidLoad
{
    [super viewDidLoad];
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T19:12:24+00:00Added an answer on June 18, 2026 at 7:12 pm

    Move your reload tableview call to here.

    -(void)getJSONfromURL:(NSURL *)url {
    
        NSURLRequest *request = [NSURLRequest requestWithURL:url];
        // setup AFNetworking stuff
        AFJSONRequestOperation *operation = [AFJSONRequestOperation JSONRequestOperationWithRequest:request success:^(NSURLRequest *request, NSHTTPURLResponse *response, id JSON) {
            // call delegate or processing method on success
    
           // [self.myJSON = (NSArray *)JSON];
    
            self.myJSON = [JSON valueForKey:@"data"];
            [self.tableView reloadData];
           //NSLog(@" in get JSon method %@", self.myJSON);
    
        } failure:^(NSURLRequest *request, NSHTTPURLResponse *response, NSError *error, id JSON) {
            NSLog(@"Request Failed with Error: %@, %@", error, error.userInfo);
        }];
    
    
        [operation start];
    
    
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using AFNetworking to parse JSON data on UITableView. YouTube api give JSON
i am using AFNetworking to parse youtube JSON data on a UITableView. For some
I am attempting to use AFNetworking with an XML-RPC based API while using GDataXML
I'm trying to send a JSON request using AFNetworking and have a problem with
I'm using AFNetworking to make a web request. After the web request completes. I
I have a Table View which displays images using lazy loading from AFNetworking with
I'm just starting using AFNetworking and have come across an anomaly when using enqueueBatchOfHTTPRequestOperations
I am trying to send a POST request to a server using AFNetworking, and
I am using the AFNetworking framework to make several JSON web request. During development
I'm trying to build my NSDictionnary to send to a request using the AFNetworking

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.