UITableView not updating

0 views
Skip to first unread message

Isaac Wilson

unread,
May 12, 2009, 1:05:03 AM5/12/09
to rtfm-development-...@googlegroups.com
Hi,
     One of my UITableView's isn't updating when I remove all it's entries.  I've run the debugger and verified that I'm telling it that there is only 1 section on 0 rows, but it still asks me for cells.  I can't set it to 0 sections without an error occurring in some unobservable place.  Furthermore, the when it's pushed onto the navigation controller, it still has text in it's cells.
     Has anyone else run into something like this?  If it makes a difference, this is the only time I've ever created a UITableView programmatically so I could easily have missed an initializing call.
            Isaac

Jeff Hentschel

unread,
May 12, 2009, 11:02:42 AM5/12/09
to RTFM: Development for Mobile Devices
Have you checked to make sure your delegate and datasource are set
correctly? I've never made a tableView programmatically, so I don't
know the other things you need to work out. You might try just making
another viewController and see if that works.

Nathan Nichols

unread,
May 12, 2009, 11:46:19 AM5/12/09
to rtfm-development-...@googlegroups.com
Isaac,
Are you calling -reloadData on the table? I believe that when you
tell it to reloadData, it asks its delegate/datasource for the number
of sections, how many rows in each section, calculates which cells are
visible, then ask for the cells. But the table doesn't know the
number of sections or rows have changed until it asks, and it doesn't
ask until you tell it to reload the data.

Nate

Isaac Wilson

unread,
May 12, 2009, 7:37:48 PM5/12/09
to rtfm-development-...@googlegroups.com
Problem resolved.  Something happened (I blame IB) so that I had 2 UITableViews, one on top of the other.  (Yes, delegates, datasources, -reloadDatas were being done correctly).  Namely, self.view was a UITableView and so I didn't have to create and add another programmatically.
Reply all
Reply to author
Forward
0 new messages