UITableViewCells loaded from NIB is always nil
I am trying to create a simple form using UITableViewController
as described in the Apple Developer documentation here .
What I am trying to do is in the section entitled Technique for Static Row Content
I created a pair UITableViewCells
and added them to my nib, but when I try to access them to add them to UITableView
(in the method cellForRowAtIndexPath:
) they are always zero.
It looks like they are not loading properly from the tip. I've double / triple / quadruple checked my code to make sure I am doing it exactly the same way in detail in the docs, but no luck.
Is there something obvious I'm missing here?
a source to share
Are you sure you have included IBOutlets in the nib file?
In your ViewController.h file, you must:
IBOutlet UITableViewCell *specialCell1;
IBOutlet UITableViewCell *specialCell2;
and then each of them must be "connected" to the corresponding cell in the nib file. If not, they won't!
a source to share