Reputation: 589
I am developing an iPhone app that consists of UICollectionViews
on UITableView
To make each Collection scrolls horizontally . All steps are work perfectly except when I start to scroll each UICollectionView
the UICollectionViewCell
method is reuse and
I am getting a problem with the label , the problem in the image below
I faced this issue with the title of each collection on scrolling the table view and I did this
NSString *CellIdentifier = [NSString stringWithFormat:@"CellId%d%d",indexPath.row,indexPath.section];
TableViewCell *cell = (TableViewCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if(!cell)
{
cell = [[TableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
}
I assigned unique identifier to each cell , there is any suggestions that can help ? :)
Upvotes: 2
Views: 1318
Reputation: 3203
Add this code in cellForRoAtIndexPath
methods
for (UIView *v in [cell subviews])
[v removeFromSuperview];
Tell me if its working or not :)
Upvotes: 2