I have a view xib that contains just a UITableView, which loads fine, I have it listing out data from my database. But I want to use a custom UITableViewCell, so I added one to the same xib. The reason is so that I can design it in Interface Builder instead of trying to code it.
I changed the class of the ListViewCell to a class I created that extends UITableViewCell. I've tried two ways of allocating this class in the cellForRowAtIndexPath method. First I tried:
Code:
cell = [[[ListViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:MyIdentifier] autorelease];
But that doesn't seem to use the design from within Interface Builder.
I then tried setting an IBOutlet on my UITableViewController class, and linked it to the TableViewCell using IB, and then this line:
Code:
cell = [[listViewCell initWithFrame:CGRectZero reuseIdentifier:MyIdentifier] autorelease];
But as you might imagine, it doesn't properly create a new ViewCell for each row, it gets messed up: the first two become blank and only the last row actually has a design to it.