tableView not displayed after adding HeaderView


I’m to the point in the chapter where I just added the ItemsViewController::toggleEdittingMode() function. When I run it, I don’t see the table, like Fig. 10.7 shows.

I then ran the downloaded example code, and I get the same thing, table is NOT shown.

What gives?


Duh on me. When I created the Nib, I did NOT resize the view.


I’ve got the same error.

With breakepoints set at tableView:cellForRowAtIndexPath: I conclude, that the method never gets send to the view.
Which I find kinda weird, since I send initWithStyle:UITableViewStyleGrouped.
And since I instantiated a UITableView, that view should send several messages declared in the UITableViewDataSource protocol. (Which I added.)
But no… it doesn’t.

Any help?

EDIT: Found the error… my mistake was a typo. Shame on me.



I had the same problem. I deleted the HomeView.xib file, made a new one, checked “HomePwner” as target, rebuild. Now everything works. Hope this helps.


The same thing happened to me. Go back to the xib file and right click on the “file owner”. You should see a “view” object as well as a “ViewHeader” object. The view (the physical view you created on the canvas) needs to be connected to the ViewHeader and not the view object as usual.

Connecting it to the regular view object will result in a blank screen on the phone or simulator.