views:

51

answers:

2

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

+1  A: 

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.

Yannick Compernol
Check if your array actually contains new/updated data when your reloadData is called.
Yannick Compernol
I've done some debugging, the array is updated but cellForRowAtIndexPath does't get called, on return to the view. As i say, it does run the first time when the view is loaded, but not afterwards.
Jules
You'll have to post code snippets for us to have a look at.
Yannick Compernol
Ahhh I need to remove if (cell == nil) {
Jules
+1  A: 

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];

MaxFish
Ok, I've changed to self.tableview, I left the poperty, outlet in place, do I need to hook something else up in IB ? also looking at examples I've seen the datasource and delegate don't seem to be hooked up, as shown in the screen dump, I have hooked them up.
Jules
Looking at your screenshot again I see that you have a UITableView inside a generic UIView. This may cause problems. I suggest you to make your controller a generic UIViewController that implements TableViewDelegates. The view outlet should be set to the main UIView, and (as you have done) an outlet should point to your UITableView. Sets the reference outlets again to your controller and retry.
MaxFish
If the new row is added then the tableView is being reloaded, be sure that the data correctly chenges after the edit.
MaxFish
Ahhh I need to remove if (cell == nil) {
Jules