I was trying to create a custom UITableViewCell in Interface Builder and kept setting the File's Owner and Custom Class of the actual UITableViewCell to my new custom UITableViewCell Class. I would hook up the IBOutlets from the File's Owner and get errors when it came to:
TVCell *cell = (TVCell *) [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
NSArray *topLevelObjects = [[NSBundle mainBundle] loadNibNamed:@"TVCell" owner:nil options:nil];
for(id currentObject in topLevelObjects)
{
if([currentObject isKindOfClass:[TVCell class]])
{
cell = (TVCell *)currentObject;
break;
}
}
Finally I realized you have to hook up the IBOutlets from the UITableViewCell Object, and not the File's Owner. Why is this?
Thanks