Hey guys,
I have a UITableViewController created programmatically without a XIB file like so:
@interface VideoViewController: UITableViewController
I have a navigation controller and a tabBar on the app delegate. All are done programmatically. So, here's the code inside init:
Quote:
self.title = @"Video"
[[self navigationItem] setTitle = @"Video"];
// I did not have to do this for it to work normally but I did it just in case
[[self tableView] setDelegate:self];
|
So, anyways, I try to create a custom UITableViewCell by following this tutorial:
Custom UITableViewCell Using Interface Builder | iCodeBlog
Everything looks great. Basically, the custom cell was created using a XIB file and then in IB, it is tied to the VideoViewCell class. Perfect.
But, when I try to use it, the VideoViewController does not display anything.
Quote:
- (UITableViewCell *)tableView UITableView *)tableView cellForRowAtIndexPath NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"VideoViewCell";
VideoViewCell *cell = (VideoViewCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil)
{
cell = [[[VideoViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
}
}
[[cell backgroundView] setBackgroundColor:[...];
|
In the custom cell, there's a UIView that serves as the background view. When I build and run, it shows blank. When I run the debugger, the cellForRowAtIndexPath is fine and everything checks out. It just seems to get replaced by the native cell of the UITableViewController instead of the custom cell.
When I click on the cell, my original function still works.
I'm at a lost. Can someone please direct me?
Thanks!!!!