views:

42

answers:

2

I'm trying to create a simple form using a UITableViewController as documented in the Apple Developer Documentation here:

http://developer.apple.com/iphone/library/documentation/UserExperience/Conceptual/TableView_iPhone/TableViewCells/TableViewCells.html

What I'm trying to do is located in the section entitled: "The Technique for Static Row Content"

I've created a couple of UITableViewCells and added them to my nib, but when I try and access them to add them to the UITableView (in the cellForRowAtIndexPath method) they are always null.

It's like they are not being properly loaded from the nib. I've double/triple/quadruple checked my code to make sure I'm doing it exactly as detailed in the docs, but no luck.

Is there something obvious I'm missing here?

Thanks

A: 

Have you made sure you've connected the IBOutlets in the nib file?

In your ViewController.h file you should have:

IBOutlet UITableViewCell *specialCell1;
IBOutlet UITableViewCell *specialCell2;

and then each of these should be "wired up" to the corresponding cell in the nib file. If not, they won't exist!

h4xxr
I've got that... It still doesn't work. I just tried a very simple test project and it worked fine, so I think it's something about how I'm creating the parent view controller.
Jason B
A: 

Figured it out...

When I added my parent view controller, I was using the simple "init". Switching to "initWithNibName" resolved the issue...

Still learning... :)

Jason B