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

  • Home
  • SEARCH
  • 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 944323
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T22:34:28+00:00 2026-05-15T22:34:28+00:00

I am having trouble getting my UITableViewController to reload/refresh the data. I have a

  • 0

I am having trouble getting my UITableViewController to reload/refresh the data.

I have a method which uses ASIHTTPRequest to call a URL and bring back some string data. I am trying to put this data into a cell of the table, but [self.tableview reloadData] is not working.

I was thinking that the ASIHTTPRequest completes its tasks on a separate thread, so I tried:

[self.tableView performSelectorOnMainThread:@selector(reloadData) withObject:nil waitUntilDone:NO];

which also did nothing.

How can I reload the data? I have been stuck on this for some time now.

Code:
MainViewController.h

#import <UIKit/UIKit.h>
@class ProductClass;
@interface MainViewController : UITableViewController {
 ProductClass *item;
}
@property (nonatomic, retain) ProductClass *item;
@end

MainViewController.m

#import "MainViewController.h"
#import "ASIHTTPRequest.h"
#import "ProductClass.h"

@implementation MainViewController
@synthesize item;

- (void) viewDidLoad {
 self.title = @"TableView Test";
 self.tableView.allowsSelection = NO;
 self.item = [[ProductClass alloc] init];
    [self callURL];
}

-(void)callURL {
    NSURL *url = [NSURL URLWithString:@"http://urlgoeshere.com"];
    ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:url];
 [request setDelegate:self];
 [request startAsynchronous];
}


- (void)requestFinished:(ASIHTTPRequest *)request {
 //Grab the response
 NSString *responseString = [request responseString];
        //Put the result into the ProductClass item
 item.titleOfProduct = responseString;

    //This line shows that self.tableview does NOT have an address of 0x0
 NSLog(@"%@\n", self.tableView); 

    //Problem line!!!!!! 
    [self.tableView performSelectorOnMainThread:@selector(reloadData) withObject:nil waitUntilDone:NO];
    //The below lines also do nothing!!!!
 //[self.tableView reloadData];
 //[[self tableView] reloadData];
}

Anyone have any ideas??? I am at a total loss.

Cheers,
Brett

  • 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-05-15T22:34:29+00:00Added an answer on May 15, 2026 at 10:34 pm

    You don’t need the performSelectorOnMainThread – asihttprequest always calls the selectors on the main thread.

    Have you setup a datasource for the table? You need to setup at least some of the fields datasource, see:

    http://developer.apple.com/iphone/library/documentation/UIKit/Reference/UITableViewDatasource_Protocol/Reference/Reference.html

    At least cellForRowAtIndexPath and numberOfRowsInSection. There’s a tutorial here that may help:

    http://icodeblog.com/2008/08/08/iphone-programming-tutorial-populating-uitableview-with-an-nsarray/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 542k
  • Answers 542k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Try to write all columns in your INSERT explicitly: STMT… May 17, 2026 at 3:09 am
  • Editorial Team
    Editorial Team added an answer The connection is encrypted even if the SSL certificate isn't… May 17, 2026 at 3:09 am
  • Editorial Team
    Editorial Team added an answer type.IsGenericType && type.GetGenericTypeDefinition() == typeof(Nullable<>) You might also find Nullable.GetUnderlyingType(Type… May 17, 2026 at 3:09 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

Having trouble getting this to work. What's strange is that I have 10 bookmarks
I'm having trouble getting a td to have some text at its top and
Having trouble getting this to apply in MySQL Workbench 5.2.15 DELIMITER // CREATE DEFINER=`potts`@`%`
Having trouble getting the correct bounds for my iPad application when launching it in
having trouble getting my directx going I get the following error 1>Linking... 1>main.obj :
Having trouble getting my JQuery POST to be accepted by the WCF Service. Here's
Im having trouble getting a function within a function working, do you think what
I having trouble getting append() to work in safari for some reason, but it
I'm having trouble getting a rotary encoder to work properly with AVR micro controllers.
Im having trouble getting my head round subqueries in Mysql. Fairly simple ones are

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.