Q:

How to use reloadData method of tableView iphone

I have one UITableViewController class. I am using NSMutableArray to fill table cells. I am fetching data from databse & adding it to array. But cell is showing old results. How can I use reladData method & where should I call this method in my UITableViewController?

A:

I quote Apple's documentation when to not use it:

The table view's delegate or data
  source calls this method when it wants
  the table view to completely reload
  its data. It should not be called in
  the methods that insert or delete
  rows, especially within an animation
  block implemented with calls to
  beginUpdates and endUpdates.

So call it when you changed your model but not using the tableview methods to alter the table like:
deleteRowsAtIndexPaths:withRowAnimation:
deleteSections:withRowAnimation:
insertRowsAtIndexPaths:withRowAnimation:
insertSections:withRowAnimation:

A:

you can reload your table cell using
//fetch data from database.. and update array

//reload table data asper new data

[self.tableView reloadData];

