HeaderView not showing up


#1

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?


#2

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.

Nick
http://myfirstiphoneapp.co.uk


#3

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.


#4

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

This fixed my problem.

Cheers


#5

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”.


#6

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?

Thanks


#7

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.


#8

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


#9

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.