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

mraheel

macrumors regular
Original poster
Apr 18, 2009
136
0
Hi guys,

Im trying to have an option where I have two kinds Custom classes of UITableViewCells. Lets say one is bigger and the other is smaller, [detailed, small] interms of tableviewcell height.

with regards to the datasource, its a custom NSObject with a BOOL "Expanded"



Hence in CellForRow
Code:
	Ob *newOb = (Ob *)[currMainArray objectAtIndex:indexPath.row];
	
		if(newOb.Expanded) {
                    		DetailedCell *cell = (DetailedCell *)[self.maintableView dequeueReusableCellWithIdentifier:@"DetailedCell"];
//do the setting and 
return cell;
}
else {
SmallerCell *cell = (SmallerCell *)[self.maintableView dequeueReusableCellWithIdentifier:@"SmallerCell"];
//do the setting and 
return cell;
}
THis part does actually work the way it should. If I add
newOb.Expanded = YES; it displays the DetailedCell.

the problem is the HeightForRow isnt getting switched.
Code:
	Ob *newOb = (Ob *)[currMainArray objectAtIndex:indexPath.row];
	if(newOb.Expanded == YES)
		return 100;
	else
		return 44;

Problem is, the Cell changes, but the height remains the same old = 44 and not 100.

Whats going wrong here?
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.