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 9243287
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T08:46:41+00:00 2026-06-18T08:46:41+00:00

I’m working with TWrequest to display my twitter lists in a tableview. The following

  • 0

I’m working with TWrequest to display my twitter lists in a tableview. The following code works. The problem is it is very slow to update the table. I am NSlogging the request response (which happens very quickly), I am also looping through each list and adding the list ‘name’ to an array (which again, happens very quickly <1s). But for some inexplicable reason, the table takes roughly a further 4 seconds or so to update.

Why is this taking so long for the table to reload? The problem is not parsing the response (because I can see with nslog this happens pretty quick), it’s taking a long time to display in the table? Help very much appreciated!

-(IBAction)getLists{

    //  First, we need to obtain the account instance for the user's Twitter account
    ACAccountStore *store = [[ACAccountStore alloc] init];

    ACAccountType *twitterAccountType = [store accountTypeWithAccountTypeIdentifier:ACAccountTypeIdentifierTwitter];

    //  Request permission from the user to access the available Twitter accounts
    [store requestAccessToAccountsWithType:twitterAccountType withCompletionHandler:^(BOOL granted, NSError *error) {

        if (!granted) {
            // The user rejected your request
            NSLog(@"User rejected access to the account.");
        }
        else {

            // Grab the available accounts
            twitterAccounts = [store accountsWithAccountType:twitterAccountType];

            if ([twitterAccounts count] > 0) {

                // Use the first account for simplicity
                ACAccount *account = [twitterAccounts objectAtIndex:0];

                // Now make an authenticated request to our endpoint
                NSMutableDictionary *params = [[NSMutableDictionary alloc] init];
                //[params setObject:@"1" forKey:@"include_entities"];

                //  The endpoint that we wish to call
                NSURL *url = [NSURL URLWithString:@"http://api.twitter.com/1.1/lists/list.json"];

                //  Build the request with our parameter
                TWRequest *request = [[TWRequest alloc] initWithURL:url parameters:params requestMethod:TWRequestMethodGET];

                // Attach the account object to this request
                [request setAccount:account];

                [request performRequestWithHandler:^(NSData *responseData, NSHTTPURLResponse *urlResponse, NSError *error) {

                    if (!responseData) {
                        // inspect the contents of error
                        NSLog(@"error = %@", error);
                    }
                    else {

                        NSError *jsonError;

                        NSArray *timeline = [NSJSONSerialization JSONObjectWithData:responseData options:NSJSONReadingMutableLeaves error:&jsonError];

                        if (timeline) {

                            // at this point, we have an object that we can parse
                            NSLog(@"timeline = %@", timeline);

                            for (NSDictionary *element in timeline) {

                                NSString *listName = [element valueForKey:@"name"];
                                [listsArray addObject:listName];

                            }

                            [listsTable reloadData];

                        }

                        else {
                            // inspect the contents of jsonError
                            NSLog(@"jsonerror = %@", jsonError);
                        }

                    }
                }];

            } 
        } 
    }];

}
  • 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-18T08:46:43+00:00Added an answer on June 18, 2026 at 8:46 am

    Sorry, just came across this post. If you haven’t found a solution yet, hopefully this will help.

    I believe that performRequestWithHandler can be called on any thread, so UI changes should be dispatched to the main thread.

    dispatch_async(dispatch_get_main_queue(), ^{
    //update UI here
    });
    

    Or in the case of reloading table data you can use:

    [self.tableView performSelectorOnMainThread:@selector(reloadData) withObject:nil    waitUntilDone:NO];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am trying to understand how to use SyndicationItem to display feed which is
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I have this code to decode numeric html entities to the UTF8 equivalent character.
In my XML file chapters tag has more chapter tag.i need to display chapters
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I've tracked down a weird MySQL problem to the two different ways I was
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.

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.