Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

LARRYSE

macrumors newbie
Original poster
Aug 22, 2012
12
0
i have created an app that fills a tableview with a property from an customer object. this object contains 3 properties, item1, item2, and item3. if item1 equals the title name i want to show item2 in my cell. this is partially working as it formats the cell to the correct height and shows alternating colours but the text does not show.
if i just show all item2's the text appears.
here is my code
Code:
    if (cell == nil)
    {
        cell = [[UITableViewCell alloc] initWithStyle: UITableViewCellStyleDefault reuseIdentifier:@"cell"];
    }
    
    
    //Add a detail view accessory
    cell.accessoryType = UITableViewCellAccessoryDetailDisclosureButton;
    
    //Step 3: Set text
	CatQA *catQA = [questionAnswersList objectAtIndex:indexPath.row];
   
//             NSLog(@"%@",catQA.question);

    if(catQA.cat == self.title)
    {
       cell.textLabel.text = catQA.question;
    }
	
    
	cell.textLabel.font = [UIFont systemFontOfSize:17];
    cell.textLabel.numberOfLines = 0;
    cell.textLabel.lineBreakMode = UILineBreakModeWordWrap;
    
    //Step 4: return index row
    return cell;
if i remove the if it will show all item2's text, but with if just correct sizing of cell but no text.
any suggestions? thanks
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.