Images getting mixed up when scrolling in a UITableView

Bulppouct

New Member
Hi found the answer here: Images getting mixed up in a UITableView - XML parsingI'm parsing an XML file with links to images which I'm putting into a UITable. For some reason the pictures are getting completely mixed up when I scroll down in the table. Here's the code I'm using for my UITable:\[code\]- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ static NSString *CellIdentifier = @"Cell"; Tweet *currentTweet = [[xmlParser tweets] objectAtIndex:indexPath.row]; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier]; CGRect imageFrame = CGRectMake(2, 8, 40, 40); customImage = [[UIImageView alloc] initWithFrame:imageFrame]; [cell.contentView addSubview:customImage]; } NSString *picURL = [currentTweet pic]; if (![picURL hasPrefix:@"http:"]) { picURL = [@"http:" stringByAppendingString:picURL]; } customImage.image = [UIImage imageWithData:[NSData dataWithContentsOfURL: [NSURL URLWithString:picURL]]]; return cell;}\[/code\]Any idea what I'm doing wrong? Any help is seriously appreciated. Thx!
 
Back
Top