Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iPhone, why isn't UITableView reloadData working?

I've enclosed a screen dump to make things easier to follow.

I've attached my outlets for datasource and delegate and I've created an outlet for my table view, but reloadData doesn't work?

Ideally I'd like to only call reloadData after the view has been loaded once?

alt text

like image 791
Jules Avatar asked Oct 01 '10 08:10

Jules


2 Answers

Create a property for your UITableView and use the property as your IBOutlet, using the ivar directly isn't the way to do it. Hook things up again and debug it, to see if your UITableView isn't nil.

Put a breakpoint in the UITableView datasource methods to see if they get called, if they are, check if your transactionsArray actually contains items.

If this doesn't help, you'll have to provide more info like which methods are being called and more code.

like image 75
ynnckcmprnl Avatar answered Nov 12 '22 06:11

ynnckcmprnl


If the main view of your UITableViewController is your table view, you can avoid using IBOutlets and use directly the tableView property of your controller. Like this:

[self.tableView reloadData];

like image 35
MaxFish Avatar answered Nov 12 '22 04:11

MaxFish