HeaderView not showing up


I have included HeaderView.xib as described in the book but it is not showing up on the Simulator.
I have reviewed the code twice and tried to create a new project but no luck.
Is there any way to check what is missing in my code?


One thing you could do (if you haven’t already), is download the source code for the book from the Big Nerd Ranch website.

Then you can check line for line if your code is correct, and you can also compare the XIB files to make sure everything is hooked up correctly.



Perhaps, you want to recheck your connection of the IBOutlet UIView *headerView to its file’s owner: ItemsViewController. This connection is important since what the method below does is only to load the nib file and hook it up with its file’s owner.

Without the connection, it is NOT specified that ItemsViewController is the owner of the view objects in the XIB file.


You guys have to check whether the IBOutlet instance variable in the .h is connected to the headerView.

This fixed my problem.



I had the same problem and wondered why. Now I see I missed an important little phrase “make the connections shown in fig. 10.5”.


My code matches the downloaded version.
My connections match the downloaded version.
I’ve tried setting a breakpoint when the headerView is returned.
The headerView variable is populated, but inspecting it does not seem to give away any confirmation that it is actually my HeaderView.
I’ve tried restarting XCode but the behavior does not change.

Is there anything else that could cause the headerView to not display?

Is there any way to confirm the XIB file has actually been loaded?



I decided to move on to the next step in the chapter. As soon as I removed the initial rows, I could see the header buttons show up faintly. However I can’t click on the buttons. My assumption is that the row view has a higher z-index than the headerView.
Any ideas on how that happened or what I can do to fix it would be greatly appreciated.



Thanks so much for spotting that - I was going mad!


Thank you so much, bouche! Making the connections shown in 10.5 made the difference. I’m starting to despair that I keep making these errors. I hope get a better feel for this as I progress.