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

gandalfbp

macrumors newbie
Original poster
Nov 6, 2009
2
0
Hi,

I have a TableView what loads it's cells from XIB's:
Code:
- (UITableViewCell *) tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    
    static NSString *MyIdentifier = @"MyIdentifier2";
	
	GeoLoc *aGeoLoc = [appDelegate.ClosestArray objectAtIndex:indexPath.row];
	if (haveStat) {
		GeoLocCellWithSlots *aCell = (GeoLocCellWithSlots *)[tableView dequeueReusableCellWithIdentifier:MyIdentifier];
		if (aCell == nil){
			[[NSBundle mainBundle] loadNibNamed:@"GeoLocCellWithSlots" owner:self options:nil];  
			aCell = geoCellWithSlots;
			self.geoCellWithSlots = nil;
		}
		[aCell setGeoLoc:aGeoLoc];
		return aCell;
	}
	else {
		GeoLocCell *aCell = (GeoLocCell *)[tableView dequeueReusableCellWithIdentifier:MyIdentifier];
		if (aCell == nil){
			[[NSBundle mainBundle] loadNibNamed:@"GeoLocCell" owner:self options:nil];
			aCell = geoCell;
			self.geoCell = nil;
		}
		[aCell setGeoLoc:aGeoLoc];
		return aCell;
	}
}

The two cells are different height. I set up the list's rowHeight in the viewDidLoad. The list contains only one kind of cells: either short ones, or tall ones, they are not mixed. If I set up the list from the taller, than the shorter, the cells are not redrawn correctly: some garbage will stay from the taller cell (the red, green, purple text).
How can I force the list to redraw itself completly?
What did I made wrong?
 

Attachments

  • x.png
    x.png
    73.3 KB · Views: 181
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.