how to reload table view in iphone application

14,226

Solution 1

In your UITableViewController, you own a UITableView, call reloadData on this tableView will reload your table view's data

[self.tableView reloadData];

Solution 2

It's not clear for me why you push self? First you should refresh the table data, which is used for table data source and then call. Assume myEntriesProvied is an instance that provides you with new entries and myEntries is an array of entries that is used as data source of your table view:

self.myEntries = [myEntriesProvider getNewEntries];    
[self.tableView reloadData];
Share:
14,226
Nauman.Khattak
Author by

Nauman.Khattak

Going to exploer PHP

Updated on June 04, 2022

Comments

  • Nauman.Khattak
    Nauman.Khattak almost 2 years

    I am displaying 10 feed in UItable view and below i have added a button with name load more 20.. by clicking this button i am passing argument to the xml and in return i want to reload the table view with fresh content. welll my question is that how to the view again.

    i am trying somthing like this

    -(IBAction)loadMore20
    {   
        //myview.hidden = FALSE;
    
        //[myview startAnimating];
    
        feedurl = @"http://www.luxury.net/feed/index_blatest.php?more=10";
    
        NavigationTitle =@"Luxury.net - Babes";
    
        [self.navigationController pushViewController:self animated:YES];       
    }
    

    Thanks in Advance and sorry for my bad english.

  • Nauman.Khattak
    Nauman.Khattak over 13 years
    i want to reload data by clicking the button laod more 20
  • vodkhang
    vodkhang over 13 years
    What is your problem? You want to call the method load20, or you want to call the model to retrieve and parse XML
  • vodkhang
    vodkhang over 13 years
    Because, your last question is "in return i want to reload the table view with fresh content", then what I understand is your want to call [tableView reloadData]