I have a subclass of PFQueryTableViewController that I am trying to show in a container view (as a subview). My problem is that I cannot get the custom cells to show in the tableview. I have verified the following via debugging:
- The tableview is being added to the parent view
- The tableview is a PFQueryTableView Controller as it includes the default pull to refresh
- The PFQuery is returning the correct number of objects
- The CellForRowAtIndexPath method is being called and iterating through the correct number of times
- The correct data from Parse is being passed to the different labels in the cells
- The labels are connected via IBOulets in my subclass of UITableViewCell. When I am trying to access the labels it is working correctly as it accesses the subclass and label
I have everything working here correctly except that the cell actually shows up! What am I missing?
This is my cellForRowAtIndexPath code:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath object:(PFObject *)object{
static NSString *CellIdentifier = @"RoundCell";
RoundCell* cell = [tableView dequeueReusableCellWithIdentifier: CellIdentifier];
if (cell == nil)
{
cell = [[RoundCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
}
// get string values from Parse
NSString * teeString =[object objectForKey:@"roundTee"];
NSString* courseString = [object objectForKey:@"roundCourse"];
NSString * courseString2 = [[courseString stringByAppendingString:@" - "]stringByAppendingString:teeString];
NSString * dateString = [object objectForKey:@"roundDate"];
NSString * scoreString = [object objectForKey:@"roundScore"];
NSString * differentialString = [object objectForKey:@"roundDifferential"];
cell.courseNameCell.text = courseString2;
cell.dateCell.text = dateString;
cell.scoreCell.text= scoreString;
cell.differentialCell.text=differentialString;
return cell;
}