I am using customized table view to show my data from Data Core, it’s supposed to be looked like this

but what I’ve actually got is this

and this is my code:
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
return [[self.fetchedResultsController sections] count];
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
id <NSFetchedResultsSectionInfo> sectionInfo = [[self.fetchedResultsController sections] objectAtIndex:section];
return [sectionInfo numberOfObjects];
}
- (void)configureCell:(UITableViewCell *)cell atIndexPath:(NSIndexPath *)indexPath
{
Item *item = [self.items objectAtIndex:indexPath.row];
UILabel *nameLabel = (UILabel *)[cell viewWithTag:100];
nameLabel.text = item.name;
UILabel *catLabel = (UILabel *)[cell viewWithTag:101];
catLabel.text = item.category;
UILabel *amountLabel = (UILabel *)[cell viewWithTag:102];
amountLabel.text = item.amount;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"AccountCell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
[self configureCell:cell atIndexPath:indexPath];
return cell;
}
Your other datasource methods are working because you can see that there are cells present, but nothing is populated.
This line:
Is not usual when you are using a fetched results controller. It should be
If you check in the debugger you will see that item is probably nil with your current code.
If that isn’t the case then your tags don’t match up between the prototype cell and your code. Again, this can be checked in the debugger – the labels will be nil.