I have created a custom TableView by following this Custom UITableViewCell
I creared a CustomerCell and then use it like this in ViewController:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
NSString *uniqueIdentifier = @"cutomerCell";
CustomerCell *cell = nil;
cell = (CustomerCell *) [self.tableview dequeueReusableCellWithIdentifier:uniqueIdentifier];
Customer *customer = [self.customers objectAtIndex:[indexPath row]];
if(!cell)
{
NSArray *topLevelObject = [[NSBundle mainBundle] loadNibNamed:@"CustomerCell" owner:nil options:nil];
for(id currentObject in topLevelObject)
{
if([currentObject isKindOfClass:[CustomerCell class]])
{
cell = (CustomerCell *) currentObject;
break;
}
}
}
cell.nameLabel.text = customer.name;
return cell;
}
Everything works fine. But then I start the next link UINavigationController
The problem is when I use this method:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
NSLog(@ "hi");
}
When I click on an item in TableView, nothing happen. It could be because of I implement the Custom TableView and then I can’t use didSelectRowAtIndexPath method, but how can I fix it?
The error you are getting is related to your nib and not your UITableView. You should check if the view of Customer Detail class is connected to its owner in the nib. That is why it crashes as soon as you try to use