0

I am making an nav based app. in my table view i am parsing a xml and showing its data. when i enter new feed item in my xml and click refresh button, my data updates but it didn't appear in tableView untill i scroll it down. When i scroll it down it appears. Can anybody tell me why its happening like that? I want new data appear when i enter the feed item without scrolling my tableView down. Thanx for help

Piscean
  • 3,069
  • 12
  • 47
  • 96

7 Answers7

2

you need to call [self.tableView reloadData] to update the tableView with new contents

Waqas Raja
  • 10,802
  • 4
  • 33
  • 38
1

Did you call [tableView reloadData] when the data has been refreshed?

Heng-Cheong Leong
  • 824
  • 1
  • 8
  • 13
1

I'm not exactly sure what you mean. A simple reload is: [myTableView reloadData] in the UITableViwController [self.tableView reloadData]

If you scroll down, new cells that are rendered will use the new data. but cells that are on display have to be told to update immediatly.

Rene Berlin
  • 1,171
  • 7
  • 21
1

You need to reload the cells (or the entire table) for the new data to appear. Depending on if you return parsed results right away or all results after the entire xml-file has been parsed.

The code to update the table is:

[myTableView reloadData];
David Rönnqvist
  • 56,267
  • 18
  • 167
  • 205
1

You have to call [tableView reloadData] to refresh the data from the UITableView.

PrimaryChicken
  • 963
  • 1
  • 8
  • 29
1

Call [tableView reloadData] when the parsing is completed

visakh7
  • 26,380
  • 8
  • 55
  • 69
0

Not just -reloadData, you can use any of these:

  • reloadData
  • reloadRowsAtIndexPaths:withRowAnimation:
  • reloadSections:withRowAnimation:
  • reloadSectionIndexTitles

Basically, you'll need to tell your tableview that your data has changed so it knows to change that. You can do it with fancy animations and whatnot so that the user isn't confused when what's displayed on screen suddenly changes.

Samuel Goodwin
  • 1,698
  • 13
  • 17